-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(*): add missing imports for custom errors #5767
Conversation
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 found one more like these:
const { Error: DJSError } = require('../../errors'); |
and
this.debug(`Manager was destroyed. Called by:\n${new Error('MANAGER_DESTROYED').stack}`); |
Considering we don't seem to be using the global Error
anywhere in there, the imported class shouldn't be renamed and all occurrences of DJSError
should be changed to Error
.
I don't actually see that error key in the messages file. Given it's only used to get the stack, it doesn't strictly need to be a DJSError but I see no reason for it not to be. So just make sure to add the corresponding message |
Done. btw I took an easy way out by just copying the same message. 😆 |
Because there is no key for that error, in fact it could even be empty for all it matters :D |
Please describe the changes this PR makes and why it should be merged:
Since, custom errors have same names as native errors, they get left un-imported sometimes. Which results in errors that don't have any message in it. This PR fixes it by importing these errors in places where they are being used but were not imported.
Status and versioning classification: