initial commit
This commit is contained in:
commit
4b60ece582
327 changed files with 28286 additions and 0 deletions
15
magnus/lib/httpError.js
Normal file
15
magnus/lib/httpError.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
"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;
|
Loading…
Add table
Add a link
Reference in a new issue