shimstack
Version:
Middleware for functions
27 lines (22 loc) • 574 B
JavaScript
// --------------------
// shimstack module
// Custom error constructor
// --------------------
// modules
var util = require('util');
// exports
module.exports = ShimstackError;
/**
* Constructor for all errors thrown by shimstack.
* Exposed as `shimstack.Error`.
*
* @constructor
* @param {string} message - Error message
*/
function ShimstackError(message) {
var tmp = Error.call(this, message);
this.name = this.constructor.name;
this.message = tmp.message;
Error.captureStackTrace(this, this.constructor);
}
util.inherits(ShimstackError, Error);