Skip to content

Error tag incorrectly set (node 11) #3898

Closed
@mfanto

Description

@mfanto

All requests, including with the Hello World tutorial on https://hapijs.com, show the error tag.

Are you sure this is an issue with the hapi core module or are you just looking for some help?

Yes, I believe so.

Is this a security related issue?

No

What are you trying to achieve or the steps to reproduce?

Using the following example: https://gist.github.com/mfanto/9ffac7d26a26cd1649c9ff6810be9d73

What was the result you received?

Debug: request, error, close
{ request: true, error: true, close: true }
Debug: response, error, close
{ response: true, error: true, close: true }

The error tag is set to true, both through debugging turned on, as well as the server request event.

What did you expect?

The error tag to not be set.

Context

  • node version: 11.6.0
  • hapi version: 17.8.1
  • os: Mac OSX

I think the problem is with this line:

request._log(err ? ['request', 'error'] : ['request', 'error', event], err);

Regardless if err is truthy or not, it always sets the error tag.

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions