Fix a bug in error parsing #21

Merged
joeybaker merged 3 commits from better-error into master 2016-09-05 19:25:14 +00:00
Showing only changes of commit b032be20d1 - Show all commits

View File

@ -14,14 +14,15 @@ export default (target, key, descriptor) => {
if (code && (code.startsWith('22') || code.startsWith('23'))) {
const error = Boom.wrap(e, 406);
// detail tends to be more specific information. So, if we have it, use.
if (detail) {
error.message += `: ${detail}`;
error.reformat();
}
reply(error);
// detail tends to be more specific information. So, if we have it, use.
if (detail) {
error.message += `: ${detail}`;
error.reformat();
}
}
reply(error);
} else if (!e.isBoom) {
const { message } = e;
let err;