diegosouzapw/OmniRoute · error · Error

result?.error?.message || result?.error || result?.message…

Error message

result?.error?.message || result?.error || result?.message || t("suiteBuilderSaveFailed")

What it means

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.

Solutions

  1. Read result.error.message for the failing case/field
  2. Ensure every case has required model + messages and valid thresholds
  3. Fix the flagged fields and re-save the draft
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx:727 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/45c4c42c603db0b5. Report an issue: GitHub.

Appendix: source

Thrown at src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx:727

              .split(",")
              .map((tag) => tag.trim())
              .filter(Boolean),
          };
        }),
      };

      const isEditing = typeof suiteDraft.id === "string" && suiteDraft.id.trim().length > 0;
      const response = await fetch(
        isEditing ? `/api/evals/suites/${encodeURIComponent(suiteDraft.id!)}` : "/api/evals/suites",
        {
          method: isEditing ? "PUT" : "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify(payload),
        }
      );
      const result = await response.json();
      if (!response.ok) {
        throw new Error(
          result?.error?.message || result?.error || result?.message || t("suiteBuilderSaveFailed")
        );
      }

      await refreshDashboard();
      setExpanded(result?.suite?.id || suiteDraft.id || null);
      setIsBuilderOpen(false);
      setSuiteDraft(createEmptySuiteDraft());
      notify.success(
        isEditing ? t("suiteBuilderUpdated") : t("suiteBuilderCreated"),
        t("notifyEvalTitle", { name: suiteName })
      );
    } catch (error: any) {
      notify.error(
        t("notifyEvalRunFailedWithReason", {
          reason: error?.message || t("notAvailableSymbol"),
        }),
        t("suiteBuilderSaveFailed")

View on GitHub (pinned to a179ffed5b)