change ctx.throw() to no longer .expose 5xx errors. Closes #197
This commit is contained in:
parent
7e66aca8c3
commit
0610a841df
2 changed files with 2 additions and 1 deletions
|
@ -72,7 +72,7 @@ var proto = module.exports = {
|
|||
|
||||
var err = msg instanceof Error ? msg : new Error(msg);
|
||||
err.status = status || 500;
|
||||
err.expose = true;
|
||||
err.expose = err.status < 500;
|
||||
throw err;
|
||||
},
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ describe('ctx.throw(msg)', function(){
|
|||
ctx.throw('boom');
|
||||
} catch (err) {
|
||||
assert(500 == err.status);
|
||||
assert(false === err.expose);
|
||||
done();
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue