Skip to content

[REQUEST] Better Errors in http validate headers #16714

Description

@bradennapier
  • Version: 9.0
  • Platform: OSX

Just spent a good 2 hours trying to track down the reason for an error message. Whle the stack pointed to a nodejs source file, I wasn't sure if it was one of the packages reporting it or something else. I didn't even know where the problem was coming from:

https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js#L497-L508

Here it just gives this:

0|developm | 3:55:21:346 am | [SERVER] |  [ERROR] | API REQUEST | Error Caught during Request |  rJZmo6tCZ session /v2/system/session TypeError [ERR_MISSING_ARGS]: The "value" argument must be specified
0|developm |     at validateHeader (_http_outgoing.js:501:11)
0|developm |     at ClientRequest.setHeader (_http_outgoing.js:510:3)

It feels like this should actually say what the problem was rather than having to find the source code and browse through it looking for the possible reasons for things.

Maybe something like `"HTTP Header $headername is undefined."

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    errorsIssues and PRs related to JavaScript errors originating in Node.js core.httpIssues and PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions