{"record":{"id":"e5fd1bea6f01eb9b","repo":"diegosouzapw/OmniRoute","slug":"errorbody-error-message-errorbody-error","errorCode":null,"errorMessage":"errorBody?.error?.message || errorBody?.error || \"Failed to update mode pack\"","messagePattern":"errorBody\\?\\.error\\?\\.message \\|\\| errorBody\\?\\.error \\|\\| \"Failed to update mode pack\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/combos/IntelligentComboPanel.tsx","lineNumber":94,"sourceCode":"  const handleModePackChange = async (modePackId: string) => {\n    if (!combo?.id || modePackId === normalizedConfig.modePack) return;\n    setSavingModePack(modePackId);\n\n    try {\n      const response = await fetch(`/api/combos/${combo.id}`, {\n        method: \"PUT\",\n        headers: { \"Content-Type\": \"application/json\" },\n        body: JSON.stringify({\n          config: {\n            ...(combo?.config || {}),\n            modePack: modePackId,\n          },\n        }),\n      });\n\n      if (!response.ok) {\n        const errorBody = await response.json().catch(() => null);\n        throw new Error(\n          errorBody?.error?.message || errorBody?.error || \"Failed to update mode pack\"\n        );\n      }\n\n      const updatedCombo = await response.json();\n      onComboUpdated?.(updatedCombo);\n      notify.success(\n        getI18nOrFallback(t, \"modePackUpdated\", \"Mode pack updated to {pack}.\", {\n          pack: modePackId,\n        }).replace(\"{pack}\", modePackId)\n      );\n    } catch (error: any) {\n      notify.error(error?.message || \"Failed to update mode pack.\");\n    } finally {\n      setSavingModePack(null);\n    }\n  };\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/combos/IntelligentComboPanel.tsx#L76-L112","documentation":"handleModePackChange's PUT to /api/combos/<id> (config.modePack swap) returned non-OK; the thrown message prefers errorBody.error.message, then errorBody.error, then the literal 'Failed to update mode pack'. savingModePack is cleared in finally, so only the inline error reflects the failure.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/combos/IntelligentComboPanel.tsx:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate that modePackId exists and is assignable to the combo","Surface the server error message to the user","Check server logs for the failing PUT"],"exampleFix":null,"handlingStrategy":"fallback","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"}