diegosouzapw/OmniRoute · error · Error

t("proxySubscription.nameRequired")

Error message

t("proxySubscription.nameRequired")

What it means

Client-side form validation in the subscription save flow: it fires before any network call when form.name trimmed to empty. It is a pure guard on user input — the thrown localized 'nameRequired' message means the subscription record lacks the mandatory display name.

Solutions

  1. Enter a non-blank subscription name before saving
  2. Trim whitespace — the check uses form.name.trim()
  3. No retry logic needed; the request was never sent
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/settings/components/proxy/SubscriptionTab.tsx:149 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/60a5a8adc775a915. Report an issue: GitHub.

Appendix: source

Thrown at src/app/(dashboard)/dashboard/settings/components/proxy/SubscriptionTab.tsx:149

  const startEdit = (sub: SubscriptionRecord) => {
    setEditingId(sub.id);
    setForm({
      name: sub.name,
      url: sub.url,
      mode: sub.mode,
      ruleProviders: sub.ruleProviders ?? [],
      localCoreEndpoint: sub.localCoreEndpoint ?? "",
      updateIntervalMinutes: sub.updateIntervalMinutes,
      enabled: sub.enabled,
    });
    setShowForm(true);
  };

  const save = async () => {
    setSaving(true);
    setFormError(null);
    try {
      if (!form.name.trim()) throw new Error(t("proxySubscription.nameRequired"));
      if (!form.url.trim()) throw new Error(t("proxySubscription.urlRequired"));
      if (form.mode === "rule" && form.ruleProviders.length === 0) {
        throw new Error(t("proxySubscription.ruleModeProviderRequired"));
      }
      const payload = {
        name: form.name.trim(),
        url: form.url.trim(),
        mode: form.mode,
        ruleProviders: form.mode === "rule" ? form.ruleProviders : null,
        localCoreEndpoint: form.localCoreEndpoint.trim() || null,
        updateIntervalMinutes: Number(form.updateIntervalMinutes) || 60,
        enabled: form.enabled,
      };
      const res = editingId
        ? await fetch(`/api/v1/management/proxy-subscriptions/${editingId}`, {
            method: "PATCH",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify(payload),

View on GitHub (pinned to a179ffed5b)