Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Oct 5, 2022
1 parent 4b45605 commit cf47f6c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ class HttpBackend {
console.log("Aborting HTTP request: %s %s", opts.method,
opts.uri);
self.requests.splice(idx, 1);
// @TODO replace this with AbortError and remove special handling in js-sdk
// @ts-ignore
req.callback("aborted");
const e = new Error("aborted");
e.name = "AbortError";
req.callback(e);
}
};

Expand Down Expand Up @@ -124,7 +124,9 @@ class HttpBackend {
if (idx >= 0) {
console.log("Aborting HTTP request: %s %s", requestOpts.method, requestOpts.uri);
this.requests.splice(idx, 1);
reject("aborted");
const e = new Error("aborted");
e.name = "AbortError";
reject(e);
}
});
});
Expand Down

0 comments on commit cf47f6c

Please sign in to comment.