From b032be20d129be51a7b5d3b0a380f0c8ef0c287b Mon Sep 17 00:00:00 2001 From: Joey Baker Date: Sun, 4 Sep 2016 17:25:57 -0700 Subject: [PATCH] Fix (error) always reply with an error #oops We had a case where reply would never be called. This could case a server hang. --- src/error.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/error.js b/src/error.js index af49e86..a9d0510 100644 --- a/src/error.js +++ b/src/error.js @@ -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;