Skip to content

Commit

Permalink
fix: changed error label
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-ippolito committed Nov 18, 2022
1 parent 3550038 commit 0d3ac30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ ServerResponse.prototype.writeHead = writeHead;
function writeHead(statusCode, reason, obj) {

if (this._header) {
throw new ERR_HTTP_HEADERS_SENT('writeHead');
throw new ERR_HTTP_HEADERS_SENT('write');
}

const originalStatusCode = statusCode;
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-http-write-head.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const s = http.createServer(common.mustCall((req, res) => {
}, {
code: 'ERR_HTTP_HEADERS_SENT',
name: 'Error',
message: 'Cannot writeHead headers after they are sent to the client'
message: 'Cannot write headers after they are sent to the client'
});

res.end();
Expand All @@ -83,7 +83,7 @@ function runTest() {
assert.throws(() => res.writeHead(200, [ 'test2', '2' ]), {
code: 'ERR_HTTP_HEADERS_SENT',
name: 'Error',
message: 'Cannot writeHead headers after they are sent to the client'
message: 'Cannot write headers after they are sent to the client'
});
res.end();
});
Expand Down

0 comments on commit 0d3ac30

Please sign in to comment.