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

  1. Read e.message — it is the server's eligibility reason and should be shown verbatim to the user.
  2. Confirm the product is published and affiliate-eligible in its settings.
  3. If the message seems wrong, replay the GET from the Network tab and inspect the JSON error field.
  4. 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

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


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