mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 08:03:30 +01:00
fix(DJSError): Differentiate error type (#11295)
* fix(DJSError): differentiate error type * fix: remove `?.`
This commit is contained in:
@@ -11,11 +11,15 @@ const Messages = require('./Messages');
|
||||
* @ignore
|
||||
*/
|
||||
function makeDiscordjsError(Base) {
|
||||
return class DiscordjsError extends Base {
|
||||
return class extends Base {
|
||||
static {
|
||||
Object.defineProperty(this, 'name', { value: `Discordjs${Base.name}` });
|
||||
}
|
||||
|
||||
constructor(code, ...args) {
|
||||
super(message(code, args));
|
||||
this.code = code;
|
||||
Error.captureStackTrace?.(this, DiscordjsError);
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
|
||||
get name() {
|
||||
|
||||
Reference in New Issue
Block a user