fix(DJSError): Differentiate error type (#11295)

* fix(DJSError): differentiate error type

* fix: remove `?.`
This commit is contained in:
Jiralite
2025-11-22 20:22:55 +00:00
committed by GitHub
parent db41d5cb68
commit 02fc101069

View File

@@ -12,11 +12,15 @@ const { Messages } = require('./Messages.js');
* @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() {