Opal-Estate-Pro/node_modules/error/io.js

22 lines
470 B
JavaScript
Raw Normal View History

2019-09-13 06:27:52 +02:00
'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;
}