{"record":{"id":"9573d04037ac4fd3","repo":"diegosouzapw/OmniRoute","slug":"internal-003","errorCode":"INTERNAL_003","errorMessage":"Circuit breaker open","messagePattern":"Circuit breaker open","errorType":"error_code","errorClass":null,"httpStatus":503,"severity":"error","filePath":"src/shared/constants/errorCodes.ts","lineNumber":211,"sourceCode":"    httpStatus: 400,\n    category: \"COMBO\",\n  },\n\n  // ── Internal ──\n  INTERNAL_001: {\n    code: \"INTERNAL_001\",\n    message: \"Internal server error\",\n    httpStatus: 500,\n    category: \"INTERNAL\",\n  },\n  INTERNAL_002: {\n    code: \"INTERNAL_002\",\n    message: \"Database error\",\n    httpStatus: 500,\n    category: \"INTERNAL\",\n  },\n  INTERNAL_003: {\n    code: \"INTERNAL_003\",\n    message: \"Circuit breaker open\",\n    httpStatus: 503,\n    category: \"INTERNAL\",\n  },\n};\n\nexport function createErrorResponse(code: string, details: ErrorDetails = {}) {\n  const def = ERROR_CODES[code];\n  if (!def) {\n    return {\n      error: {\n        code: \"INTERNAL_001\",\n        message: `Unknown error code: ${code}`,\n        category: \"INTERNAL\",\n      },\n      status: 500,\n    };\n  }","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/constants/errorCodes.ts#L193-L229","documentation":"INTERNAL_003 (503): the provider circuit breaker for the target is OPEN — repeated upstream failures temporarily blocked the provider. Requests are refused fast until the reset timeout elapses and a half-open probe succeeds.","triggerScenarios":"Thrown at src/shared/constants/errorCodes.ts:211 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the breaker reset window (30–60s by profile) then retry","Route to a different provider via combo fallback","Investigate the underlying provider failures that tripped the breaker"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}