docs context: throw defaults to 500

This commit is contained in:
Jonathan Ong 2013-12-18 01:30:27 -08:00
parent dc20952996
commit 6b33d4d1ae

View file

@ -1,4 +1,3 @@
# Context # Context
A Koa Context encapsulates node's `request` and `response` objects A Koa Context encapsulates node's `request` and `response` objects
@ -114,8 +113,8 @@
### ctx.throw(msg, [status]) ### ctx.throw(msg, [status])
Helper method to throw an error with a `.status` property Helper method to throw an error with a `.status` property
that will allow Koa to respond appropriately. The following defaulting to `500` that will allow Koa to respond appropriately.
combinations are allowed: The following combinations are allowed:
```js ```js
this.throw(403) this.throw(403)
@ -135,4 +134,4 @@ throw err;
`err.expose` meaning the messages are appropriate for `err.expose` meaning the messages are appropriate for
client responses, which is typically not the case for client responses, which is typically not the case for
error messages since you do not want to leak failure error messages since you do not want to leak failure
details. details.