diegosouzapw/OmniRoute · error

INTERNAL_002

INTERNAL_002

Error message

Database error

What it means

Canonical error-code entry INTERNAL_002 (HTTP 500, INTERNAL category): a SQLite operation through the db layer failed (disk I/O, locked database, constraint failure below the domain-module level). Surfaces when no more specific domain error code applies to the database failure.

Solutions

  1. Check disk space and file permissions on the DATA_DIR
  2. Run the vacuum/backup tooling if the DB is bloated or locked
  3. Restore from the latest backup if corruption is suspected
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/shared/constants/errorCodes.ts:205 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/a6437c425d1fdd78. Report an issue: GitHub.

Appendix: source

Thrown at src/shared/constants/errorCodes.ts:205

    httpStatus: 404,
    category: "COMBO",
  },
  COMBO_008: {
    code: "COMBO_008",
    message: "Combo target violates its provider or model family invariant",
    httpStatus: 400,
    category: "COMBO",
  },

  // ── Internal ──
  INTERNAL_001: {
    code: "INTERNAL_001",
    message: "Internal server error",
    httpStatus: 500,
    category: "INTERNAL",
  },
  INTERNAL_002: {
    code: "INTERNAL_002",
    message: "Database error",
    httpStatus: 500,
    category: "INTERNAL",
  },
  INTERNAL_003: {
    code: "INTERNAL_003",
    message: "Circuit breaker open",
    httpStatus: 503,
    category: "INTERNAL",
  },
};

export function createErrorResponse(code: string, details: ErrorDetails = {}) {
  const def = ERROR_CODES[code];
  if (!def) {
    return {
      error: {
        code: "INTERNAL_001",

View on GitHub (pinned to a179ffed5b)