antiwork/gumroad · error · ResponseError
Something went wrong.
Error message
Something went wrong.
What it means
The fallback throw in createThumbnail (app/javascript/data/thumbnails.ts:27) fires when the POST to Routes.link_thumbnails_path returns response.ok === false without reaching the success:false branch. Because request() already maps 5xx, 429, and network failures to their own errors, this is a 4xx: 401 (session expired), 403 (product not editable by this seller), or 404 (permalink does not resolve to a link). The message is the generic ResponseError default 'Something went wrong.'.
Source
Thrown at app/javascript/data/thumbnails.ts:27
export const createThumbnail = async (permalink: string, thumbnailPayload: ThumbnailPayload): Promise<Thumbnail> => {
const response = await request({
method: "POST",
accept: "json",
url: Routes.link_thumbnails_path(permalink),
data: {
thumbnail: { signed_blob_id: thumbnailPayload.signedBlobId },
},
});
if (response.ok) {
const responseData = typia.assert<{ success: true; thumbnail: Thumbnail } | { success: false; error: string }>(
await response.json(),
);
if (responseData.success) return responseData.thumbnail;
throw new ResponseError(responseData.error);
}
throw new ResponseError();
};
export const deleteThumbnail = async (permalink: string, thumbnailId: string) => {
const response = await request({
method: "DELETE",
accept: "json",
url: Routes.link_thumbnail_path(permalink, thumbnailId),
});
if (response.ok) {
const responseData = typia.assert<{ success: true; thumbnail: Thumbnail } | { success: false }>(
await response.json(),
);
if (responseData.success) return;
}
throw new ResponseError();
};View on GitHub (pinned to afeacbd394)
Solutions
- Reload the product edit page — a fresh page reloads permalink and session together
- Verify the permalink still resolves (open the product's public/preview URL)
- Confirm the acting seller has edit permission on the product
- Check the POST's status code in the network tab to distinguish 401/403/404
- Parse the 4xx body for an error field and surface it instead of the generic message
Example fix
// before
throw new ResponseError();
// after — keep the server's reason when it sent one
const body: unknown = await response.json().catch(() => null);
throw new ResponseError(typia.is<{ error: string }>(body) ? body.error : "Could not add the thumbnail."); Defensive patterns
Strategy: try-catch
Validate before calling
const validPermalink = (p: string) => p.trim() !== "";
if (!validPermalink(permalink)) throw new Error("Missing product permalink"); Type guard
const isResponseError = (e: unknown): e is ResponseError => e instanceof ResponseError;
Try / catch
try {
await createThumbnail(permalink, payload);
} catch (e) {
assertResponseError(e);
if (e.message === "Something went wrong.") void location.reload(); // 401 session expiry heals on reload
else showError(e.message);
} Prevention
- Reload the edit page after long idle periods so session and permalink state stay fresh
- Confirm the seller owns/controls the product before offering the thumbnail editor
- Check the POST status in the network tab before debugging the uploader
When it happens
Trigger: Creating a thumbnail when the product edit page was open past session expiry (401); the permalink in the URL state is stale after the product was renamed/deleted (404); a seller without edit rights on the product posts to it (403).
Common situations: Editing a product in two tabs where one renamed or deleted it; long-lived edit sessions; deep-linked edit pages for products the account lost access to; tests hitting the endpoint unauthenticated.
Related errors
- Something went wrong.
- Something went wrong.
- Something went wrong.
- Something went wrong.
- Something went wrong.
AI-assisted analysis of antiwork/gumroad@afeacbd394 (2026-08-21).
Data as JSON: /api/errors/3ea79275f3576511.
Report an issue: GitHub.