Skip to content

Logging boom errors from handlers should send boom error to log not just message #2308

@dschenkelman

Description

@dschenkelman

When the response value is a boom object the following code is used to log (from here):

if (response.isBoom) {
    request._log(['handler', 'error'], { msec: timer.elapsed(), error: response.message });
    return callback(response);
}

This does not send the entire error instance but only the message. It is can be valuable to be able to log additional information such as the status code.

Proposal:

if (response.isBoom) {
    request._log(['handler', 'error'], { msec: timer.elapsed(), error: response });
    return callback(response);
}

Sending a PR with the change and a test.

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions