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
parent e32f0c141a
commit f5b3f842e3

View File

@@ -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() {