change ctx.throw() to no longer .expose 5xx errors. Closes #197

This commit is contained in:
TJ Holowaychuk 2014-01-20 18:44:07 -08:00
parent 7e66aca8c3
commit 0610a841df
2 changed files with 2 additions and 1 deletions

View file

@ -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;
},

View file

@ -10,6 +10,7 @@ describe('ctx.throw(msg)', function(){
ctx.throw('boom');
} catch (err) {
assert(500 == err.status);
assert(false === err.expose);
done();
}
})