Fix force 404

This commit is contained in:
Jim Laurie 2017-07-26 18:23:53 +02:00
parent c8a8f0f7ff
commit 7396bc21bd

View File

@ -50,9 +50,10 @@ module.exports = async function(ctx, next) {
: Boom.wrap(error, ctx.status, ctx.body || error.message);
}
console.log(ctx.body, ctx.status);
// Empty body is considered as `notFound` response.
if (_.isUndefined(ctx.body) && _.isUndefined(ctx.status)) {
return ctx.notFound();
ctx.notFound();
}
if (_.isObject(ctx.body)) {