{"record":{"id":"7b1aab3ebbad0760","repo":"CherryHQ/cherry-studio","slug":"parsed-base-resp-status-msg-minimax-error-pa","errorCode":null,"errorMessage":"parsed.base_resp.status_msg || `MiniMax error ${parsed.base_resp.status_code}`","messagePattern":"parsed\\.base_resp\\.status_msg \\|\\| `MiniMax error (.+?)`","errorType":"exception","errorClass":"APICallError","httpStatus":null,"severity":"error","filePath":"src/main/ai/provider/custom/minimax/minimaxImageModel.ts","lineNumber":117,"sourceCode":"    }\n\n    let parsed: MinimaxImageResponse\n    try {\n      parsed = JSON.parse(responseBody) as MinimaxImageResponse\n    } catch (cause) {\n      throw new APICallError({\n        message: 'Invalid JSON response from MiniMax',\n        cause,\n        url,\n        requestBodyValues: body,\n        statusCode: response.status,\n        responseHeaders: headersRecord,\n        responseBody\n      })\n    }\n\n    if (parsed.base_resp?.status_code && parsed.base_resp.status_code !== 0) {\n      throw new APICallError({\n        message: parsed.base_resp.status_msg || `MiniMax error ${parsed.base_resp.status_code}`,\n        url,\n        requestBodyValues: body,\n        statusCode: response.status,\n        responseHeaders: headersRecord,\n        responseBody\n      })\n    }\n\n    return {\n      images: [...(parsed.data?.image_urls ?? []), ...(parsed.data?.image_base64 ?? [])],\n      warnings: [],\n      response: {\n        timestamp: this.config._internal?.currentDate?.() ?? new Date(),\n        modelId: this.modelId,\n        headers: headersRecord\n      }\n    }","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/CherryHQ/cherry-studio/blob/726446b54cd69ffe51a276638672f6d95ca0768c/src/main/ai/provider/custom/minimax/minimaxImageModel.ts#L99-L135","documentation":"Thrown as an `APICallError` when a 2xx MiniMax response carries a non-zero `base_resp.status_code`. MiniMax signals application-level failures (content moderation, invalid model, param errors) inside an otherwise-OK HTTP response via the `base_resp` object, rather than with an HTTP error status. The message is `base_resp.status_msg`, falling back to `MiniMax error {code}`.","triggerScenarios":"HTTP succeeded but MiniMax's business logic rejected the request: prompt failed content review, the model id is invalid/unavailable, or a parameter value is semantically invalid for the chosen model.","commonSituations":"Prompt or subject-reference image tripped MiniMax content moderation; requested model not enabled for the account; `aspect_ratio`/`size` not supported by the selected model.","solutions":["Read `base_resp.status_msg` and `status_code` for the specific business error and adjust the request.","For content-moderation rejections, revise the prompt or subject-reference image.","Confirm the model id is valid and enabled, and that params match its documented constraints."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"const isMinimaxBusinessError = (e: unknown): boolean =>\n  e instanceof APICallError && /MiniMax error/.test(e.message)","tryCatchPattern":"try {\n  await model.doGenerate(opts)\n} catch (e) {\n  if (e instanceof APICallError && e.message.includes('MiniMax error')) {\n    // base_resp business error — read e.message for status_msg, adjust prompt/params\n  }\n  throw e\n}","preventionTips":["Remember MiniMax returns business errors inside 2xx via base_resp — don't rely on HTTP status alone","Surface status_msg to the user","Revise prompts/params on content-moderation rejections"],"tags":["api-error","minimax","business-error","content-moderation","base-resp"],"backgroundTag":null,"analyzedSha":"726446b54cd69ffe51a276638672f6d95ca0768c","analyzedAt":"2026-08-12T17:30:37.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}