{"record":{"id":"3e2ad4600fc35f03","repo":"earendil-works/pi","slug":"statustext-request-failed-with-status-status","errorCode":null,"errorMessage":"statusText || `Request failed with status ${statusCode}`","messagePattern":"statusText \\|\\| `Request failed with status (.+?)`","errorType":"http","errorClass":"MistralHttpError","httpStatus":null,"severity":"error","filePath":"packages/ai/src/api/mistral-conversations.ts","lineNumber":310,"sourceCode":"): Promise<AsyncIterable<MistralCompletionEvent>> {\n\tconst baseUrl = new URL(model.baseUrl);\n\tbaseUrl.pathname = `${baseUrl.pathname.replace(/\\/+$/u, \"\")}/`;\n\tconst url = new URL(\"v1/chat/completions\", baseUrl);\n\tconst headers = buildMistralHeaders(model, apiKey, options);\n\tconst timeoutSignal = AbortSignal.timeout(options?.timeoutMs ?? 60_000);\n\tconst signal = options?.signal ? AbortSignal.any([options.signal, timeoutSignal]) : timeoutSignal;\n\tconst response = await (options?.fetch ?? globalThis.fetch)(url, {\n\t\tmethod: \"POST\",\n\t\theaders,\n\t\tbody: JSON.stringify(toMistralWirePayload(payload)),\n\t\tsignal,\n\t});\n\n\tawait options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model);\n\n\tif (!response.ok) {\n\t\tconst body = await response.text();\n\t\tthrow new MistralHttpError(response.status, body, response.statusText);\n\t}\n\tif (!response.body) {\n\t\tthrow new Error(\"Mistral response has no body\");\n\t}\n\n\treturn readMistralEvents(response.body, signal);\n}\n\nclass MistralHttpError extends Error {\n\tstatusCode: number;\n\tbody: string;\n\n\tconstructor(statusCode: number, body: string, statusText: string) {\n\t\tsuper(statusText || `Request failed with status ${statusCode}`);\n\t\tthis.name = \"MistralHttpError\";\n\t\tthis.statusCode = statusCode;\n\t\tthis.body = body;\n\t}","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/ai/src/api/mistral-conversations.ts#L292-L328","documentation":"Error \"statusText || `Request failed with status ${statusCode}`\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/ai/src/api/mistral-conversations.ts:310 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the HTTP status code and response body for the failure reason."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}