antiwork/gumroad · error · ResponseError

Sorry, something went wrong. Please try again.

Error message

Sorry, something went wrong. Please try again.

What it means

Fallback shown when removing the authenticator-app (TOTP) factor fails: DELETE Routes.settings_totp_path. The response is typia-asserted to { success, error_message? }; on !response.ok or success:false it throws ResponseError with the server's error_message or this generic string. assertResponseError in the catch rethrows non-ResponseError exceptions (typia contract violations, network aborts), so real bugs aren't flattened into a toast — only genuine HTTP or success:false outcomes show this message.

Source

Thrown at app/javascript/pages/Settings/Password/Show.tsx:80

      onSuccess: (response) => {
        if (response.props.new_password) setRequireOldPassword(true);
        form.reset();
      },
    });
  };

  const handleRemoveAuthenticatorApp = asyncVoid(async () => {
    setRemovingAuthenticatorApp(true);

    try {
      const response = await request({
        url: Routes.settings_totp_path(),
        method: "DELETE",
        accept: "json",
      });
      const result = typia.assert<{ success: boolean; error_message?: string }>(await response.json());
      if (!response.ok || !result.success) {
        throw new ResponseError(result.error_message ?? "Sorry, something went wrong. Please try again.");
      }

      showAlert("Authenticator app removed.", "success");
      setRegeneratedCodes(null);
      router.reload();
    } catch (e) {
      assertResponseError(e);
      showAlert(e.message, "error");
    } finally {
      setRemovingAuthenticatorApp(false);
    }
  });

  const handleRegenerateRecoveryCodes = asyncVoid(async () => {
    setRegenerating(true);

    try {
      const response = await request({

View on GitHub (pinned to afeacbd394)

Solutions

  1. Reload the page; if TOTP is already gone the stale state resolves itself.
  2. Retry the removal after re-authenticating.
  3. Check the DELETE response in devtools — a server error_message would have been shown verbatim.
  4. Maintainers: include error_message in failure JSON and give specific text for policy refusals (e.g. 'At least one 2FA method is required').
Defensive patterns

Strategy: try-catch

Type guard

const isTotpMutationFailure = (response: Response, result: { success?: boolean }): boolean =>
  !response.ok || result.success !== true;

Try / catch

try {
  const response = await request({ url: Routes.settings_totp_path(), method: "DELETE", accept: "json" });
  const result = typia.assert<{ success: boolean; error_message?: string }>(await response.json());
  if (!response.ok || !result.success) {
    throw new ResponseError(result.error_message ?? "Sorry, something went wrong. Please try again.");
  }
} catch (e) {
  assertResponseError(e); // rethrow non-ResponseError so contract bugs surface
  showAlert(e.message, "error");
}

Prevention

When it happens

Trigger: DELETE /settings/totp answers 401/419/422/500 without error_message: session or CSRF expiry, TOTP already removed elsewhere (stale UI), or a server exception.

Common situations: Two settings tabs open where one already removed TOTP; a long-lived tab with an expired authenticity token; deployments changing the route; policy requiring at least one 2FA method blocking removal.

Related errors


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