Skip to content

Commit

Permalink
fix indentation of example code in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jscheffner committed Nov 4, 2019
1 parent faf305e commit 44d41c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -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.

0 comments on commit 44d41c4

Please sign in to comment.