mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02:00
http: improve parser error messages
Include the library-provided reason in the Error’s `message`. Fixes: https://github.com/nodejs/node/issues/28468 PR-URL: https://github.com/nodejs/node/pull/28487 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
parent
fd23c12263
commit
ba565a3734
8 changed files with 49 additions and 6 deletions
|
@ -19,7 +19,7 @@ const server = createServer();
|
|||
server.on('connection', mustCall((socket) => {
|
||||
socket.on('error', expectsError({
|
||||
type: Error,
|
||||
message: 'Parse Error',
|
||||
message: 'Parse Error: Header overflow',
|
||||
code: 'HPE_HEADER_OVERFLOW',
|
||||
bytesParsed: maxHeaderSize + PAYLOAD_GET.length,
|
||||
rawPacket: Buffer.from(PAYLOAD)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue