Merge pull request #681 from PlasmaPower/update-error-handling-doc

Update error handling doc to use promises+async (v2.x)
This commit is contained in:
Yiyu He 2016-03-14 23:16:01 +08:00
commit 9ba2f9c5df

View file

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