diff options
author | XadillaX <i@2333.moe> | 2017-12-14 07:40:32 +0300 |
---|---|---|
committer | Gibson Fahnestock <gibfahn@gmail.com> | 2018-02-08 12:00:14 +0300 |
commit | 56401a45dc5a0c6cafa0f329316bf5e9a7055dc8 (patch) | |
tree | d5c81c43aef997da746b2c9f2fd4d328cd431566 /doc/api/http.md | |
parent | 96f85e4d8b02335583b32b2f1cd38aee8169aa25 (diff) |
http: add rawPacket in err of `clientError` event
The `rawPacket` is the current buffer that just parsed. Adding this
buffer to the error object of `clientError` event is to make it possible
that developers can log the broken packet.
PR-URL: https://github.com/nodejs/node/pull/17672
Backport-PR-URL: https://github.com/nodejs/node/pull/18370
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/http.md')
-rw-r--r-- | doc/api/http.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/api/http.md b/doc/api/http.md index e13e45a36ad..a4ed90269d6 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -734,6 +734,11 @@ changes: description: The default action of calling `.destroy()` on the `socket` will no longer take place if there are listeners attached for `clientError`. + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/17672 + description: The rawPacket is the current buffer that just parsed. Adding + this buffer to the error object of clientError event is to make + it possible that developers can log the broken packet. --> * `exception` {Error} @@ -765,6 +770,12 @@ object, so any HTTP response sent, including response headers and payload, *must* be written directly to the `socket` object. Care must be taken to ensure the response is a properly formatted HTTP response message. +`err` is an instance of `Error` with two extra columns: + ++ `bytesParsed`: the bytes count of request packet that Node.js may have parsed + correctly; ++ `rawPacket`: the raw packet of current request. + ### Event: 'close' <!-- YAML added: v0.1.4 |