poe-api-manager
Version:
poe.ninja and poe.watch API
23 lines (22 loc) • 640 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Represents a custom error with a message and a status code.
* @class
* @extends {Error}
*/
class CustomError extends Error {
statusCode;
/**
* Creates a new instance of CustomError.
* @param {string} message - The error message.
* @param {number} statusCode - The HTTP status code.
*/
constructor(message, statusCode) {
super(message);
this.statusCode = statusCode;
this.name = this.constructor.name;
Error.captureStackTrace(this, this.constructor);
}
}
exports.default = CustomError;