diff --git a/docs/error-handling.md b/docs/error-handling.md index 6fc579d..ba4abef 100644 --- a/docs/error-handling.md +++ b/docs/error-handling.md @@ -40,8 +40,8 @@ app.use(async (ctx, next) => { await next(); } catch (err) { // will only respond with JSON - this.status = err.statusCode || err.status || 500; - this.body = { + ctx.status = err.statusCode || err.status || 500; + ctx.body = { message: err.message }; }