-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Convert default to named exports - errors #10986
Convert default to named exports - errors #10986
Conversation
6b87d15
to
829399c
Compare
src/ui/public/errors.js
Outdated
KbnError.call(this, | ||
'Courier attempted to start a query before the previous had finished.', | ||
errors.HastyRefresh); | ||
}; | ||
_.class(errors.HastyRefresh).inherits(KbnError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really relevant to this PR, but as we're changing this code I'll ask:
Any reason we can't have class KbnError extends Errors
and class HastyRefresh extends KbnError
? If that works it would clean up this code even more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason I can see. Changed them all and added tests for a sanity check. Indeed looks much better this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ❤️ this. Much cleaner.
Jenkins failed due to #10980
jenkins, test this |
jenkins, test this |
Failed on a different test, but same function (trying to open a link from the dashboard landing page):
Going to try merging #11004 |
jenkins, test this (build aborted) |
* Convert default to named exports - errors * Make all error classes use class syntax and extends add tests * Extending Error apparently doesn't work * Merge PR elastic#11004 to try to fix test failures
* Convert default to named exports - errors * Make all error classes use class syntax and extends add tests * Extending Error apparently doesn't work * Merge PR elastic#11004 to try to fix test failures
Related to #10981, but am doing some conversions separately since it will be a large chunk of work. Plus this file wasn't a straight conversion as I got rid of the external errors object and am exporting each error individually.
Background: #8641