From 44d41c4ac3c898ec839a6388f6c96c8cb7bd80ae Mon Sep 17 00:00:00 2001 From: Jonas Scheffner Date: Mon, 4 Nov 2019 22:36:13 +0100 Subject: [PATCH] fix indentation of example code in readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a5d02c7..de7c3e3 100644 --- a/README.md +++ b/README.md @@ -70,11 +70,11 @@ Sometimes, the messages exposed to the end users are not enough to find the root To access the complete errors, including their stack, you can register an event listener: ```js - server.events.on({ name: 'request', channels: 'internal' }, (request, event, tags) => { - if (tags.auth && tags.error) { - console.log(event.error); - } - }); +server.events.on({ name: 'request', channels: 'internal' }, (request, event, tags) => { + if (tags.auth && tags.error) { + console.log(event.error); + } +}); ``` In this, debugging `hapi-auth-any` isn't different from debugging other strategies. However, in order to preserve the errors that caused `hapi-auth-any` to fail, it throws an [AggregateError](https://github.com/sindresorhus/aggregate-error), decorated with some [boom](https://github.com/hapijs/boom)-specific properties. `AggregateErrors` are iterable, which is how you can access the individual errors. \ No newline at end of file