From 74371a710055c26338b40b0cd4571c2d4e9b0e62 Mon Sep 17 00:00:00 2001 From: Peter Morlion Date: Thu, 14 May 2020 08:31:44 +0200 Subject: [PATCH] Update docs to show correct boom error output --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index bf0cd304..4b9c54b6 100644 --- a/README.md +++ b/README.md @@ -237,23 +237,24 @@ Errors are returned when a 4xx or 5xx status code is received. BoomError -As a standard [boom](https://github.com/hapijs/boom) error you can access any of the boom error properties. The total amount of information varies according to the generated status code. +As a standard [boom](https://github.com/hapijs/boom) error you can access any of the [boom error properties](https://hapi.dev/module/boom/api). The total amount of information varies according to the generated status code. ```javascript async function run() { try { await oauth2.authorizationCode.getToken(); } catch(error) { - console.log(error); + console.log(error.output); } } run(); -// => { -// "statusCode": 401, -// "error": "Unauthorized", -// "message": "invalid password" -// } +// { statusCode: 401, +// payload: +// { statusCode: 401, +// error: 'Unauthorized', +// message: 'Response Error: 401 Unauthorized' }, +// headers: {} } ``` ## Debugging the module