Fix (error) always reply with an error #oops

We had a case where reply would never be called. This could case a
server hang.
This commit is contained in:
Joey Baker 2016-09-04 17:25:57 -07:00
parent 79c6a81a3a
commit b032be20d1

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;