-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http: be more specific when reporting errors #14759
Conversation
When reporting header content errors specify header name in the message for easier debugging in user applications. Fix: nodejs#14754
How about more simply: |
@mscdex I don't mind. Although, both are consistent with existing error messages. |
@@ -440,7 +440,8 @@ function storeHeader(self, state, key, value, validate) { | |||
throw new Error('Header "%s" value must not be undefined', key); | |||
} else if (checkInvalidHeaderChar(value)) { | |||
debug('Header "%s" contains invalid characters', key); | |||
throw new TypeError('The header content contains invalid characters'); | |||
throw new TypeError( | |||
'The header content contains invalid characters ["' + key + '"]'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the error messages are being changed, it would be nice to migrate the files to use internal/errors at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specific change LGTM with a suggestion
The errors in |
@indutny ... can you give this a rebase? |
It appears your're right :-) |
When reporting header content errors specify header name in the message
for easier debugging in user applications.
Fix: #14754
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
http