{"record":{"id":"a2551d14c7d94336","repo":"diegosouzapw/OmniRoute","slug":"auth-002","errorCode":"AUTH_002","errorMessage":"Invalid API key","messagePattern":"Invalid API key","errorType":"error_code","errorClass":null,"httpStatus":401,"severity":"error","filePath":"src/shared/constants/errorCodes.ts","lineNumber":35,"sourceCode":"  httpStatus: number;\n  category: string;\n}\n\ninterface ErrorDetails {\n  detail?: string;\n  requestId?: string;\n  retryAfter?: number;\n}\n\nexport const ERROR_CODES: Record<string, ErrorCodeDef> = {\n  // ── Auth ──\n  AUTH_001: {\n    code: \"AUTH_001\",\n    message: \"Authentication required\",\n    httpStatus: 401,\n    category: \"AUTH\",\n  },\n  AUTH_002: { code: \"AUTH_002\", message: \"Invalid API key\", httpStatus: 401, category: \"AUTH\" },\n  AUTH_003: { code: \"AUTH_003\", message: \"API key expired\", httpStatus: 401, category: \"AUTH\" },\n  AUTH_004: {\n    code: \"AUTH_004\",\n    message: \"Insufficient permissions\",\n    httpStatus: 403,\n    category: \"AUTH\",\n  },\n  AUTH_005: { code: \"AUTH_005\", message: \"Account locked\", httpStatus: 423, category: \"AUTH\" },\n  AUTH_006: {\n    code: \"AUTH_006\",\n    message: \"No credentials for provider\",\n    httpStatus: 400,\n    category: \"AUTH\",\n  },\n  AUTH_007: {\n    code: \"AUTH_007\",\n    message: \"Session expired (re-login required)\",\n    httpStatus: 401,","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/constants/errorCodes.ts#L17-L53","documentation":"ERROR_CODES catalog entry AUTH_002: credentials were presented but the API key is not recognized (unknown, revoked, or mistyped), mapped to HTTP 401. It is the canonical definition consumed by auth helpers when key lookup fails — a sentinel definition, not a runtime throw site.","triggerScenarios":"Thrown at src/shared/constants/errorCodes.ts:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the API key matches one listed in the dashboard","Recreate the key if it was revoked or rotated","Check for whitespace/truncation when copying the key into the client"],"exampleFix":null,"handlingStrategy":"validation","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"}