/**
 * Helper for handling HTTP errors.
 * @extends Error
 * @description This class extends the built-in Error class to provide a way to handle HTTP errors with a status code and message.
 * @example
 * const error = new HttpError(401, "Unauthorized");
 */
export default class HttpError extends Error {
    status = 500;

    /**
     * Constructor for HttpError.
     * @param {number} httpStatusCode - The HTTP status code.
     * @param {string} message - The error message.
     */
    constructor(httpStatusCode, message = "") {
        super(message);

        this.status = httpStatusCode;
    }
}
