antiwork/gumroad · error · ResponseError

Sorry, something went wrong. Please try again.

Error message

Sorry, something went wrong. Please try again.

What it means

Generic toast shown when requesting a tax-year transaction report fails: POST Routes.tax_form_transaction_report_path(doc.year) with accept:json. Any !response.ok throws a bare ResponseError() (default 'Something went wrong.'), and the catch unconditionally shows this fixed 'Sorry, something went wrong. Please try again.' — the response body is never read, so unlike sibling handlers there is no server-message passthrough. assertResponseError still rethrows non-ResponseError exceptions, so typia/network bugs don't become a toast.

Source

Thrown at app/javascript/pages/TaxCenter/Index.tsx:118

  const { documents, available_years, selected_year } = typia.assert<{
    documents: TaxDocument[];
    available_years: number[];
    selected_year: number | null;
  }>(usePage().props);
  const loggedInUser = useLoggedInUser();
  const [isLoading, setIsLoading] = React.useState(false);
  const [downloadingFormType, setDownloadingFormType] = React.useState<string | null>(null);
  const [requestingReportFormType, setRequestingReportFormType] = React.useState<string | null>(null);

  const handleRequestTransactionReport = asyncVoid(async (doc: TaxDocument) => {
    setRequestingReportFormType(doc.form_type);
    try {
      const response = await request({
        method: "POST",
        accept: "json",
        url: Routes.tax_form_transaction_report_path(doc.year),
      });
      if (!response.ok) throw new ResponseError();
      showAlert("You will receive an email shortly with your transaction report.", "success");
    } catch (e) {
      assertResponseError(e);
      showAlert("Sorry, something went wrong. Please try again.", "error");
    }
    setRequestingReportFormType(null);
  });

  const handleYearChange = (year: number) => {
    router.reload({
      data: { year },
      onStart: () => setIsLoading(true),
      onFinish: () => setIsLoading(false),
      onError: () => showAlert("Something went wrong. Please try again.", "error"),
    });
  };

  const handleDownload = (_e: React.MouseEvent<HTMLAnchorElement>, formType: string) => {

View on GitHub (pinned to afeacbd394)

Solutions

  1. Reload the tax center page and retry the report request.
  2. Verify the selected tax year is one you had transactions in.
  3. Check the network tab: the failed POST's status code distinguishes auth (401/419) from server (5xx).
  4. Maintainers: read the response body and show its error like sibling handlers do, instead of a fixed string.

Example fix

// before
if (!response.ok) throw new ResponseError();
// after
if (!response.ok) {
  const body = typia.assert<{ error?: string }>(await response.json().catch(() => ({})));
  throw new ResponseError(body.error ?? "Sorry, something went wrong. Please try again.");
}
Defensive patterns

Strategy: try-catch

Type guard

const isReportRequestFailure = (response: Response): boolean => !response.ok;

Try / catch

try {
  const response = await request({ method: "POST", accept: "json", url: Routes.tax_form_transaction_report_path(doc.year) });
  if (!response.ok) throw new ResponseError();
  showAlert("You will receive an email shortly with your transaction report.", "success");
} catch (e) {
  assertResponseError(e); // rethrow non-ResponseError (network/typia) so bugs don't become toasts
  showAlert("Sorry, something went wrong. Please try again.", "error");
}

Prevention

When it happens

Trigger: POST /tax_forms/:year/transaction_report returns 401/419/422/500: expired session, year out of range, report generation job failing to enqueue, or a server exception. No body is parsed, so this is purely an HTTP-status outcome.

Common situations: Tax-center tabs left open past session expiry, report workers backed up or erroring, or invalid year values from stale UI state.

Related errors


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