detritus-client
Version:
A Typescript NodeJS library to interact with Discord's API, both Rest and Gateway.
43 lines (42 loc) • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImportedCommandsError = exports.GatewayHTTPError = exports.GatewayError = exports.ClusterIPCError = void 0;
class BaseError extends Error {
toJSON() {
return {
message: this.message,
name: this.name,
stack: this.stack,
};
}
}
class ClusterIPCError extends BaseError {
constructor(error) {
super(error.message);
this.name = error.name;
this.stack = error.stack;
}
}
exports.ClusterIPCError = ClusterIPCError;
class GatewayError extends BaseError {
constructor(error, packet) {
super(error.message);
this.originalError = error;
this.packet = packet;
}
}
exports.GatewayError = GatewayError;
class GatewayHTTPError extends BaseError {
constructor(message, httpError) {
super(message);
this.httpError = httpError;
}
}
exports.GatewayHTTPError = GatewayHTTPError;
class ImportedCommandsError extends BaseError {
constructor(errors) {
super('Error while importing multiple commands');
this.errors = errors;
}
}
exports.ImportedCommandsError = ImportedCommandsError;