diff --git a/docs/error-handling.md b/docs/error-handling.md index 1bd82a8..32b8b26 100644 --- a/docs/error-handling.md +++ b/docs/error-handling.md @@ -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;