mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +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
|
* @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