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

Commit 5d588ef

Browse files
committed
http2: improve error handling, reliability and tests
PR-URL: #134 Reviewed-By: Matteo Collina <[email protected]>
1 parent 345e917 commit 5d588ef

18 files changed

+750
-92
lines changed

lib/internal/errors.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,19 @@ E('ERR_HTTP2_INVALID_INFO_STATUS',
100100
'Invalid informational status code');
101101
E('ERR_HTTP2_INVALID_PSEUDOHEADER',
102102
(name) => `"${name}" is not a valid HTTP/2 pseudoheader`);
103+
E('ERR_HTTP2_INVALID_SESSION', 'The session has been destroyed');
104+
E('ERR_HTTP2_INVALID_SETTING_VALUE',
105+
(settings) => `An invalid HTTP/2 setting value was specified: ${settings}`);
106+
E('ERR_HTTP2_OUT_OF_STREAMS',
107+
'No stream ID is available because maximum stream ID has been reached');
103108
E('ERR_HTTP2_SOCKET_BOUND',
104109
'The socket is already bound to an Http2Session');
105110
E('ERR_HTTP2_STATUS_INVALID',
106111
(code) => `Invalid status code: ${code}`);
107112
E('ERR_HTTP2_STATUS_101',
108113
'HTTP status code 101 (Switching Protocols) is forbidden in HTTP/2');
114+
E('ERR_HTTP2_STREAM_CLOSED', 'The stream is already closed');
115+
E('ERR_HTTP2_STREAM_SELF_DEPENDENCY', 'A stream cannot depend on itself');
109116
E('ERR_HTTP2_UNSUPPORTED_PROTOCOL',
110117
(protocol) => `protocol "${protocol}" is unsupported.`);
111118
E('ERR_INVALID_ARG_TYPE', invalidArgType);
@@ -132,6 +139,7 @@ E('ERR_IPC_DISCONNECTED', 'IPC channel is already disconnected');
132139
E('ERR_IPC_ONE_PIPE', 'Child process can have only one IPC pipe');
133140
E('ERR_IPC_SYNC_FORK', 'IPC cannot be used with synchronous forks');
134141
E('ERR_MISSING_ARGS', missingArgs);
142+
E('ERR_OUTOFMEMORY', 'Out of memory');
135143
E('ERR_STDERR_CLOSE', 'process.stderr cannot be closed');
136144
E('ERR_STDOUT_CLOSE', 'process.stdout cannot be closed');
137145
E('ERR_UNKNOWN_BUILTIN_MODULE', (id) => `No such built-in module: ${id}`);

0 commit comments

Comments
 (0)