{"record":{"id":"45c4c42c603db0b5","repo":"diegosouzapw/OmniRoute","slug":"result-error-message-result-error-result","errorCode":null,"errorMessage":"result?.error?.message || result?.error || result?.message || t(\"suiteBuilderSaveFailed\")","messagePattern":"result\\?\\.error\\?\\.message \\|\\| result\\?\\.error \\|\\| result\\?\\.message \\|\\| t\\(\"suiteBuilderSaveFailed\"\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx","lineNumber":727,"sourceCode":"              .split(\",\")\n              .map((tag) => tag.trim())\n              .filter(Boolean),\n          };\n        }),\n      };\n\n      const isEditing = typeof suiteDraft.id === \"string\" && suiteDraft.id.trim().length > 0;\n      const response = await fetch(\n        isEditing ? `/api/evals/suites/${encodeURIComponent(suiteDraft.id!)}` : \"/api/evals/suites\",\n        {\n          method: isEditing ? \"PUT\" : \"POST\",\n          headers: { \"Content-Type\": \"application/json\" },\n          body: JSON.stringify(payload),\n        }\n      );\n      const result = await response.json();\n      if (!response.ok) {\n        throw new Error(\n          result?.error?.message || result?.error || result?.message || t(\"suiteBuilderSaveFailed\")\n        );\n      }\n\n      await refreshDashboard();\n      setExpanded(result?.suite?.id || suiteDraft.id || null);\n      setIsBuilderOpen(false);\n      setSuiteDraft(createEmptySuiteDraft());\n      notify.success(\n        isEditing ? t(\"suiteBuilderUpdated\") : t(\"suiteBuilderCreated\"),\n        t(\"notifyEvalTitle\", { name: suiteName })\n      );\n    } catch (error: any) {\n      notify.error(\n        t(\"notifyEvalRunFailedWithReason\", {\n          reason: error?.message || t(\"notAvailableSymbol\"),\n        }),\n        t(\"suiteBuilderSaveFailed\")","sourceCodeStart":709,"sourceCodeEnd":745,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx#L709-L745","documentation":"Suite-builder save failure: the POST (create) or PUT (edit, /suites/{id}) to the evals suites API returned non-ok; the thrown message prefers result.error.message, then result.error, then result.message, then the localized 'suiteBuilderSaveFailed'. Server-side causes: case schema validation (missing model/messages), duplicate name, or eval-store write error.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx:727 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read result.error.message for the failing case/field","Ensure every case has required model + messages and valid thresholds","Fix the flagged fields and re-save the draft"],"exampleFix":null,"handlingStrategy":"try-catch","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"}