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 scinos commented Mar 17, 2019

Fixes #416

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

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.`));
Copy link
Contributor

@caub caub Apr 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

temyers commented Apr 23, 2019

Is there any movement on this?

@LaurensBosscher
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
Copy link
Owner

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not conform to the spec when aborting an error
5 participants