diff --git a/src/v0/gateway.ts b/src/v0/gateway.ts index fb07404..63a75ff 100644 --- a/src/v0/gateway.ts +++ b/src/v0/gateway.ts @@ -37,6 +37,10 @@ export function createGateway({ try { resp = await fetch(`${baseUrl()}${path}`, options); } catch (e) { + if (e.name === 'AbortError') { + throw e; + } + if (canRetry) { await wait(attempts ** 2 * 1000); return post(path, body, attempts + 1, init); diff --git a/src/v0/graphqlFetch.ts b/src/v0/graphqlFetch.ts index 88308d3..067f141 100644 --- a/src/v0/graphqlFetch.ts +++ b/src/v0/graphqlFetch.ts @@ -114,6 +114,10 @@ export function createGraphqlFetch({ options.body = JSON.stringify(args); response = await fetch(endpoint(), options); } catch (e) { + if (e.name === 'AbortError') { + throw e; + } + // Retry if (canRetry) { await wait(attempts ** 2 * 1000);