radio/magnus/lib/httpError.js

16 lines
332 B
JavaScript
Raw Normal View History

2018-08-04 21:46:25 +00:00
"use strict";
var http = require("http");
class HttpError extends Error
{
constructor(status, message) {
super(status, message);
Error.captureStackTrace(this, HttpError);
this.status = status;
this.message = message || http.STATUS_CODES[status] || "Error";
}
}
module.exports = HttpError;