Skip to content
This repository has been archived by the owner on Jul 6, 2018. It is now read-only.

Commit

Permalink
http2: improve error handling, reliability and tests
Browse files Browse the repository at this point in the history
PR-URL: #134
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
jasnell committed May 18, 2017
1 parent 21ec223 commit 797f94f
Show file tree
Hide file tree
Showing 18 changed files with 750 additions and 92 deletions.
8 changes: 8 additions & 0 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,19 @@ E('ERR_HTTP2_INVALID_INFO_STATUS',
'Invalid informational status code');
E('ERR_HTTP2_INVALID_PSEUDOHEADER',
(name) => `"${name}" is not a valid HTTP/2 pseudoheader`);
E('ERR_HTTP2_INVALID_SESSION', 'The session has been destroyed');
E('ERR_HTTP2_INVALID_SETTING_VALUE',
(settings) => `An invalid HTTP/2 setting value was specified: ${settings}`);
E('ERR_HTTP2_OUT_OF_STREAMS',
'No stream ID is available because maximum stream ID has been reached');
E('ERR_HTTP2_SOCKET_BOUND',
'The socket is already bound to an Http2Session');
E('ERR_HTTP2_STATUS_INVALID',
(code) => `Invalid status code: ${code}`);
E('ERR_HTTP2_STATUS_101',
'HTTP status code 101 (Switching Protocols) is forbidden in HTTP/2');
E('ERR_HTTP2_STREAM_CLOSED', 'The stream is already closed');
E('ERR_HTTP2_STREAM_SELF_DEPENDENCY', 'A stream cannot depend on itself');
E('ERR_HTTP2_UNSUPPORTED_PROTOCOL',
(protocol) => `protocol "${protocol}" is unsupported.`);
E('ERR_INVALID_ARG_TYPE', invalidArgType);
Expand All @@ -132,6 +139,7 @@ E('ERR_IPC_DISCONNECTED', 'IPC channel is already disconnected');
E('ERR_IPC_ONE_PIPE', 'Child process can have only one IPC pipe');
E('ERR_IPC_SYNC_FORK', 'IPC cannot be used with synchronous forks');
E('ERR_MISSING_ARGS', missingArgs);
E('ERR_OUTOFMEMORY', 'Out of memory');
E('ERR_STDERR_CLOSE', 'process.stderr cannot be closed');
E('ERR_STDOUT_CLOSE', 'process.stdout cannot be closed');
E('ERR_UNKNOWN_BUILTIN_MODULE', (id) => `No such built-in module: ${id}`);
Expand Down
Loading

0 comments on commit 797f94f

Please sign in to comment.