Files
cloudron-box/api/httperror.js
T
Girish Ramakrishnan 6816e069a1 src -> api
2013-08-31 21:01:21 -07:00

21 lines
437 B
JavaScript

'use strict';
var util = require('util');
module.exports = HttpError;
function HttpError(statusCode, message) {
Error.call(this);
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.statusCode = statusCode;
if (typeof message == 'string') {
this.message = message;
} else {
this.message = JSON.stringify(message);
}
}
util.inherits(HttpError, Error);