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:
parent
79c6a81a3a
commit
b032be20d1
15
src/error.js
15
src/error.js
@ -14,14 +14,15 @@ export default (target, key, descriptor) => {
|
|||||||
if (code && (code.startsWith('22') || code.startsWith('23'))) {
|
if (code && (code.startsWith('22') || code.startsWith('23'))) {
|
||||||
const error = Boom.wrap(e, 406);
|
const error = Boom.wrap(e, 406);
|
||||||
|
|
||||||
// detail tends to be more specific information. So, if we have it, use.
|
// detail tends to be more specific information. So, if we have it, use.
|
||||||
if (detail) {
|
if (detail) {
|
||||||
error.message += `: ${detail}`;
|
error.message += `: ${detail}`;
|
||||||
error.reformat();
|
error.reformat();
|
||||||
}
|
|
||||||
|
|
||||||
reply(error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
reply(error);
|
||||||
} else if (!e.isBoom) {
|
} else if (!e.isBoom) {
|
||||||
const { message } = e;
|
const { message } = e;
|
||||||
let err;
|
let err;
|
||||||
|
Loading…
Reference in New Issue
Block a user