diegosouzapw/OmniRoute · error

${message}

Error message

${message}

What it means

Error "${message}" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/middleware/registry.ts:161

            new Error(`Hook "${hookName}" timed out after ${HOOK_EXECUTION_TIMEOUT_MS}ms`)
          );
        }, HOOK_EXECUTION_TIMEOUT_MS);
      });

      const result = await Promise.race([Promise.resolve(execution), timeoutGuard]);
      return (result ?? {}) as HookResult;
    } catch (err: unknown) {
      // Errors thrown from inside the vm context use the context's own
      // constructors, so they are not `instanceof` the host Error. Normalize
      // to a host Error carrying a readable message so callers/observability
      // classify it correctly.
      const message =
        err instanceof Error
          ? err.message
          : typeof err === "object" && err !== null && "message" in err
            ? String((err as { message: unknown }).message)
            : String(err);
      throw new Error(message);
    } finally {
      if (timer) clearTimeout(timer);
    }
  };
}

// ── Default context factory ──────────────────────────────────────────────

export function createHookContext(params: {
  body: Record<string, unknown>;
  headers: Record<string, string | string[] | undefined>;
  model: string;
  combo?: string;
  apiKeyInfo?: Record<string, unknown>;
  log?: any;
}): PreRequestHookContext {
  const logger = params.log || console;
  return {

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/middleware/registry.ts:161 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/7aa3dbc71d8a2ac6. Report an issue: GitHub.