-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Closed
Labels
http2Issues or PRs related to the http2 subsystem.Issues or PRs related to the http2 subsystem.
Description
- Version: v12.6.0
- Platform: Linux solus 5.1.14-121.current deps: update openssl to 1.0.1j #1 SMP PREEMPT Sun Jun 23 13:57:07 UTC 2019 x86_64 GNU/Linux
- Subsystem: http2
const http2 = require('http2');
try {
const session = http2.connect('https://example.com', {
settings: {
maxFrameSize: 1
}
});
session.on('error', error => {
console.log('Captured an error.');
});
} catch (error) {
console.log('Captured an error.');
}
Actual behavior
internal/http2/util.js:521
throw new ERR_HTTP2_INVALID_SETTING_VALUE.RangeError(
^
RangeError [ERR_HTTP2_INVALID_SETTING_VALUE]: Invalid value for setting "maxFrameSize": 1
at ClientHttp2Session.settings (internal/http2/core.js:1156:5)
at ClientHttp2Session.setupHandle (internal/http2/core.js:861:8)
at Object.onceWrapper (events.js:291:20)
at TLSSocket.emit (events.js:203:13)
at TLSSocket.onConnectSecure (_tls_wrap.js:1346:10)
at TLSSocket.emit (events.js:203:13)
at TLSSocket._finishInit (_tls_wrap.js:792:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:606:12) {
actual: 1,
min: 16384,
max: 16777215
}
Expected behavior
Captured an error.
Possible solution
It's thrown from here:
node/lib/internal/http2/core.js
Line 975 in 98d8ed6
socket.once(connectEvent, setupFn); |
I think it needs to be like:
socket.once(connectEvent, () => {
try {
setupFn();
} catch (error) {
socket.destroy(error);
}
});
Metadata
Metadata
Assignees
Labels
http2Issues or PRs related to the http2 subsystem.Issues or PRs related to the http2 subsystem.