import {HTTPStatus, Message} from '../const/http.ts' /** * Error class representing an HTTP error. * @extends Error */ export default class HTTPError extends Error { constructor( /** * The associated HTTP status code. * @type HTTPStatus */ public readonly http_status: HTTPStatus, /** * The associated message. * @type string */ public readonly http_message?: string ) { super(`HTTP ${http_status}: ${http_message || Message[http_status]}`) } }