Update error handling doc to use promises+async

master
Lee Bousfield 2016-03-12 20:19:55 -07:00
parent 882ea7e87a
commit 1d1698eb85
1 changed files with 2 additions and 2 deletions

View File

@ -6,9 +6,9 @@
this example prepends all error messages with "Error: "
```js
app.use(function*(next){
app.use(async (ctx, next) => {
try {
yield next;
await next();
} catch (error) {
error.message = 'Error: ' + error.message;
throw error;