antiwork/gumroad · error · ResponseError

Something went wrong.

Error message

Something went wrong.

What it means

pauseUpsell (app/javascript/data/upsells.ts:130-137) POSTs Routes.checkout_upsell_pause_path(id) and throws generic ResponseError ('Something went wrong.') when response.ok is false. request() already converts 5xx, 429 (RateLimitError), and network failures, so this branch means a 4xx: 404 (upsell id no longer exists — deleted in another tab), 401 (expired session), or 403. Called from the pause/resume toggle in CheckoutDashboard/UpsellsPage.tsx:222.

Source

Thrown at app/javascript/data/upsells.ts:136

    method: "DELETE",
    accept: "json",
    url: Routes.checkout_upsell_path(id),
  });
  const responseData = typia.assert<
    { success: true; upsells: Upsell[]; pagination: PaginationProps } | { success: false; error: string }
  >(await response.json());
  if (!responseData.success) throw new ResponseError(responseData.error);

  return responseData;
};

export const pauseUpsell = async (id: string) => {
  const response = await request({
    method: "POST",
    accept: "json",
    url: Routes.checkout_upsell_pause_path(id),
  });
  if (!response.ok) throw new ResponseError();
};

export const resumeUpsell = async (id: string) => {
  const response = await request({
    method: "DELETE",
    accept: "json",
    url: Routes.checkout_upsell_pause_path(id),
  });
  if (!response.ok) throw new ResponseError();
};

export const getPagedUpsells = (page: number, query: string | null, sort: Sort<SortKey> | null) => {
  const abort = new AbortController();
  const response = request({
    method: "GET",
    accept: "json",
    url: Routes.paged_checkout_upsells_path({ page, query, sort }),
    abortSignal: abort.signal,

View on GitHub (pinned to afeacbd394)

Solutions

  1. Reload the upsells page and retry the pause on a current row id
  2. Check the POST's status in the network tab (404 vs 401 vs 403) to pick the message
  3. Disable the pause/resume toggle while a toggle is in flight
  4. Catch with assertResponseError and show e.message; treat 404 as 'already gone' and refresh

Example fix

// components/CheckoutDashboard/UpsellsPage.tsx — reconcile on pause failure
try {
  await pauseUpsell(selectedUpsell.id);
} catch (e) {
  assertResponseError(e);
  void reloadUpsells(); // row may be gone; rebuild table from server truth
  showError(e.message);
}
Defensive patterns

Strategy: try-catch

Validate before calling

const rowIsLive = (id: string, rows: Upsell[]) => rows.some((u) => u.id === id);
if (!rowIsLive(id, upsells)) { void reloadUpsells(); return; }

Type guard

const isResponseError = (e: unknown): e is ResponseError => e instanceof ResponseError;

Try / catch

try {
  await pauseUpsell(id);
} catch (e) {
  assertResponseError(e);
  void reloadUpsells(); // row may be gone (404) — rebuild from server truth
  showError(e.message);
}

Prevention

When it happens

Trigger: Toggling an upsell to paused when the row was deleted in another tab (404); pausing right after session expiry (401); pausing an upsell the seller no longer owns; double-toggling fast so the second POST races the first and hits a transitional state.

Common situations: Stale dashboard tables after multi-tab editing; expired sessions on long-open dashboards; race between the toggle handler and a concurrent delete; tests stubbing the pause route with non-2xx.

Related errors


AI-assisted analysis of antiwork/gumroad@afeacbd394 (2026-08-21). Data as JSON: /api/errors/fcf96e829ee3d939. Report an issue: GitHub.