mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
errors: fix and improve error types
1) Add missing lazy assert call 2) Remove obsolete error type 3) Name undocumented error type more appropriate 4) Consolidate error type style (rely on util.format instead of using a function) 5) Uppercase the first letter from error messages 6) Improve some internal error parameters PR-URL: https://github.com/nodejs/node/pull/13857 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit is contained in:
1 parent
8ca9338655
commit
1698c8e165
9 files changed
+55
-64
No files matched your search
+2
-4
@@ -225,10 +225,8 @@ function writeHead(statusCode, reason, obj) {
|
||||
headers = obj;
|
||||
}
|
||||
|
||||
if (common._checkInvalidHeaderChar(this.statusMessage)) {
|
||||
throw new errors.Error('ERR_HTTP_INVALID_CHAR',
|
||||
'Invalid character in statusMessage.');
|
||||
}
|
||||
if (common._checkInvalidHeaderChar(this.statusMessage))
|
||||
throw new errors.Error('ERR_INVALID_CHAR', 'statusMessage');
|
||||
|
||||
var statusLine = 'HTTP/1.1 ' + statusCode + ' ' + this.statusMessage + CRLF;
|
||||
|
||||
|
||||
Reference in new issue
Block a user