2018-01-31 11:02:35 +00:00
|
|
|
module.exports.catchErrors = function(done) {
|
2017-09-10 18:04:22 +00:00
|
|
|
return error => {
|
|
|
|
if (error instanceof Error) {
|
|
|
|
return done.fail(error.stack);
|
|
|
|
}
|
|
|
|
return done.fail(JSON.stringify(error));
|
|
|
|
};
|
2018-01-31 10:15:12 +00:00
|
|
|
};
|