antiwork/gumroad · error · ResponseError
${responseData.error}
Error message
${responseData.error} What it means
The eligibility endpoint answered 200 OK with { success: false, error: string }: the server processed the lookup but the product failed the global-affiliates eligibility rules. The thrown ResponseError carries the server's own error string, so e.message is the actionable text — unlike the sibling generic throw at line 18 which covers HTTP-level failures.
Source
Thrown at app/javascript/data/global_affiliates.ts:22
export type Product = {
recommendable: boolean;
name: string;
short_url: string;
formatted_price: string;
};
export const searchGlobalAffiliatesProductEligibility = async ({ query }: { query: string }): Promise<Product> => {
const response = await request({
method: "GET",
accept: "json",
url: Routes.global_affiliates_product_eligibility_path(query),
});
if (!response.ok) throw new ResponseError();
const responseData = typia.assert<{ success: true; product: Product } | { success: false; error: string }>(
await response.json(),
);
if (!responseData.success) throw new ResponseError(responseData.error);
return responseData.product;
};
View on GitHub (pinned to afeacbd394)
Solutions
- Read e.message — it is the server's eligibility reason and should be shown verbatim to the user.
- Confirm the product is published and affiliate-eligible in its settings.
- If the message seems wrong, replay the GET from the Network tab and inspect the JSON error field.
- Do not retry the identical query — this is a deterministic domain rejection, not a transient failure.
Example fix
// caller ry {
const product = await searchGlobalAffiliatesProductEligibility({ query });
} catch (e) {
assertResponseError(e);
showError(e.message); // server's own eligibility reason, e.g. "This product isn't eligible"
} Defensive patterns
Strategy: try-catch
Type guard
const isEligibilityRejection = (json: unknown): json is { success: false; error: string } =>
typeof json === 'object' && json !== null && (json as { success?: unknown }).success === false && typeof (json as { error?: unknown }).error === 'string'; Try / catch
try {
const product = await searchGlobalAffiliatesProductEligibility({ query });
} catch (e) {
assertResponseError(e);
showError(e.message); // the server's eligibility reason — display it verbatim
} Prevention
- Treat success:false as a normal outcome of a user-driven lookup, not a defect.
- Show e.message rather than a canned string; the server wording is the diagnosis.
- Don't gate the call on client-side guesses about eligibility — the server owns the rules.
When it happens
Trigger: The queried product exists but is not eligible for the affiliates program: recommendable is false, the product type cannot be affiliated, it is unpublished/draft, or its creator has opted out. The controller renders { success: false, error } with HTTP 200.
Common situations: Testing the lookup with a membership/bundle the program does not support; pasting a link to your own product when self-referrals are excluded; the product was unpublished after the link was shared.
Related errors
- responseData.error_message
- No recovery codes were generated. Please try again.
- Something went wrong.
- typia.assert<{ error: string }>(json).error
- typia.assert<{ message: string }>(await response.json()).mes
AI-assisted analysis of antiwork/gumroad@afeacbd394 (2026-08-21).
Data as JSON: /api/errors/6397a95aa8bfbbf9.
Report an issue: GitHub.