Opal-Estate-Pro/node_modules/error/io.js
2019-09-13 11:27:52 +07:00

22 lines
470 B
JavaScript

'use strict';
module.exports = IOError;
function IOError(cause, prefix) {
var err = new Error(prefix + ': ' + cause.message);
Object.defineProperty(err, 'type', {
value: 'error.IOError',
configurable: true,
enumerable: true
});
err.name = 'WrappedIOError';
err.statusCode = 500;
Object.defineProperty(err, 'cause', {
value: cause,
configurable: true,
enumerable: false
});
return err;
}