antiwork/gumroad · error · AffiliationAlreadyRemovedError

This affiliation was already removed. Refreshing your affili

Error message

This affiliation was already removed. Refreshing your affiliations.

What it means

Error "This affiliation was already removed. Refreshing your affiliations." thrown in antiwork/gumroad.

Source

Thrown at app/javascript/data/affiliated_products.ts:63

    super("This affiliation was already removed. Refreshing your affiliations.");
  }
}

type AffiliationRemovedData = PagedAffiliatedProductsData & { stats: AffiliatedPageStats };

export const removeSelfAsAffiliate = async (
  affiliateId: string,
  { query, sort }: { query?: string; sort?: Sort<SortKey> | null } = {},
): Promise<AffiliationRemovedData> => {
  const response = await request({
    method: "DELETE",
    accept: "json",
    url: Routes.products_affiliated_path(affiliateId, { query, sort }),
  });
  // A stale row 404s with the HTML error page, so parse only once the response is
  // known good — a JSON parse failure here would escape the caller's catch and
  // strand the confirm modal in its in-flight state.
  if (response.status === 404) throw new AffiliationAlreadyRemovedError();
  if (!response.ok) {
    const body = await response.text();
    let message = "Sorry, something went wrong. Please try again.";
    try {
      // A role that may view this page but not remove affiliations gets a 401 naming the role —
      // worth showing rather than replacing with a generic failure.
      message = typia.assert<{ error: string }>(JSON.parse(body)).error;
    } catch {
      /* non-JSON body: keep the generic message */
    }
    throw new ResponseError(message);
  }
  return typia.assert<AffiliationRemovedData>(await response.json());
};

View on GitHub (pinned to afeacbd394)

When it happens

Trigger: Thrown at app/javascript/data/affiliated_products.ts:63 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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