From 1d1698eb853718890d55ef634096f9db57b9450b Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Sat, 12 Mar 2016 20:19:55 -0700 Subject: [PATCH] Update error handling doc to use promises+async --- docs/error-handling.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;