Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbortError implementation #418

Closed
wants to merge 1 commit into from
Closed

AbortError implementation #418

wants to merge 1 commit into from

Conversation

@scinos
Copy link
Contributor

scinos commented Mar 17, 2019

Fixes #416

Returns an AbortError instead of a plain Error when aborting a request

Fixes #416
Returns an AbortError instead of a plain Error when aborting a request
@scinos scinos changed the title Fixes #416 AbortError implementation Mar 17, 2019
@@ -41,7 +51,7 @@ FetchMock.fetchHandler = function(url, options, request) {
return new this.config.Promise((res, rej) => {
if (options && options.signal) {
const abort = () => {
rej(new Error(`URL '${url}' aborted.`));

This comment has been minimized.

Copy link
@caub

caub Apr 1, 2019

Contributor

maybe you could just do

const error = new Error(`URL '${url}' aborted.`);
error.name = 'AbortError';
rej(error);

but well, you're right, the way you did is more correct, nvm

@temyers

This comment has been minimized.

Copy link

temyers commented Apr 23, 2019

Is there any movement on this?

@LaurensBosscher

This comment has been minimized.

Copy link

LaurensBosscher commented Jul 3, 2019

Any progress on this, is there any way I could assist with this? I ran into this today :)

@wheresrhys wheresrhys mentioned this pull request Jul 21, 2019
@wheresrhys

This comment has been minimized.

Copy link
Owner

wheresrhys commented Jul 21, 2019

Closing in favour of #440

Sorry for taking so long to address this, and thanks for doing most of the work @scinos

@wheresrhys wheresrhys closed this Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.