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