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

NesError breaks if passed an error event from onerror. #90

Closed
tkh44 opened this issue Jan 19, 2016 · 0 comments
Closed

NesError breaks if passed an error event from onerror. #90

tkh44 opened this issue Jan 19, 2016 · 0 comments
Assignees
Labels
bug
Milestone

Comments

@tkh44
Copy link
Contributor

@tkh44 tkh44 commented Jan 19, 2016

You can recreate it by creating your own error event and passing it through NesError.

var NesError = function NesError(err, type) {
​
    if (typeof err === 'string') {
        err = new Error(err);
    }
​
    err.type = type;
    return err;
};
​
var stringErr = new NesError('stringError', 'ws'); //<- works
var errorErr = new NesError(new Error('errorError'), 'ws'); //<- works

var e = new Event('error', { bubbles: true, cancelable: false }); // <- `Cannot set property type of #<Event> which has only a getter`
var eventErr = new NesError(e, 'ws');
@hueniverse hueniverse added the bug label Jan 20, 2016
@hueniverse hueniverse added this to the 2.1.1 milestone Jan 20, 2016
@hueniverse hueniverse self-assigned this Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.