{"record":{"id":"429d4de75e494ecc","repo":"diegosouzapw/OmniRoute","slug":"data-error-message-data-error-failed-to-re","errorCode":null,"errorMessage":"data.error?.message || data.error || \"Failed to reorder combos\"","messagePattern":"data\\.error\\?\\.message \\|\\| data\\.error \\|\\| \"Failed to reorder combos\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/combos/page.tsx","lineNumber":1073,"sourceCode":"    resetComboDragState();\n\n    if (fromIndex === null || fromIndex === dropIndex) return;\n\n    const previousCombos = combos;\n    const nextCombos = moveArrayItem(combos, fromIndex, dropIndex);\n    setCombos(nextCombos);\n    setSavingComboOrder(true);\n\n    try {\n      const res = await fetch(\"/api/combos/reorder\", {\n        method: \"POST\",\n        headers: { \"Content-Type\": \"application/json\" },\n        body: JSON.stringify({ comboIds: nextCombos.map((combo) => combo.id) }),\n      });\n      const data = await res.json();\n\n      if (!res.ok) {\n        throw new Error(data.error?.message || data.error || \"Failed to reorder combos\");\n      }\n\n      if (Array.isArray(data.combos)) {\n        setCombos(data.combos);\n      }\n    } catch {\n      setCombos(previousCombos);\n      notify.error(getI18nOrFallback(t, \"failedReorder\", \"Failed to save combo order\"));\n    } finally {\n      setSavingComboOrder(false);\n    }\n  };\n\n  if (loading) {\n    return (\n      <div className=\"flex flex-col gap-6\">\n        <CardSkeleton />\n        <CardSkeleton />","sourceCodeStart":1055,"sourceCodeEnd":1091,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/combos/page.tsx#L1055-L1091","documentation":"The combo drag-reorder's POST to /api/combos/reorder with the optimistic comboIds order returned non-OK; message prefers data.error.message/data.error over 'Failed to reorder combos'. The UI already applied the new order optimistically — the catch must rely on this throw to know a rollback is needed.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/combos/page.tsx:1073 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the catch path rolls back to previousCombos","Validate the comboIds payload matches the server contract","Check server logs for the failing reorder"],"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"}