{"record":{"id":"21edf8d9f17e4ae3","repo":"diegosouzapw/OmniRoute","slug":"vision-api-error-response-status-errortext","errorCode":null,"errorMessage":"Vision API error ${response.status}: ${errorText}","messagePattern":"Vision API error (.+?): (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/guardrails/visionBridgeHelpers.ts","lineNumber":842,"sourceCode":"                  image_url: {\n                    url: normalizedImageInput,\n                    detail: \"high\",\n                  },\n                },\n                { type: \"text\", text: config.prompt },\n              ],\n            },\n          ],\n          max_tokens: 300,\n        }),\n      });\n    }\n\n    clearTimeout(timeoutId);\n\n    if (!response.ok) {\n      const errorText = await response.text().catch(() => \"Unknown error\");\n      throw new Error(`Vision API error ${response.status}: ${errorText}`);\n    }\n\n    const data = await readVisionResponseBody(response);\n\n    if (isAnthropic) {\n      // Anthropic response format: { content: [{ type: \"text\", text: \"...\" }] }\n      const anthropicData = data as {\n        content?: Array<{ type?: string; text?: string }>;\n        error?: { message?: string };\n      };\n\n      if (anthropicData.error) {\n        throw new Error(\n          `Vision API error: ${anthropicData.error.message || JSON.stringify(anthropicData.error)}`\n        );\n      }\n\n      const textContent = anthropicData.content?.find((c) => c.type === \"text\");","sourceCodeStart":824,"sourceCodeEnd":860,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/guardrails/visionBridgeHelpers.ts#L824-L860","documentation":"Error \"Vision API error ${response.status}: ${errorText}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/guardrails/visionBridgeHelpers.ts:842 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}