Skip to content

Commit

Permalink
quic: handle unhandled rejections on QuicSession
Browse files Browse the repository at this point in the history
PR-URL: #34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
jasnell committed Jul 16, 2020
1 parent e5d963e commit 16b32ea
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/internal/quic/core.js
Expand Up @@ -1688,6 +1688,10 @@ class QuicSession extends EventEmitter {
socket[kAddSession](this);
}

[kRejections](err, eventname, ...args) {
this.destroy(err);
}

// Used to get the configured options for peer initiated QuicStream
// instances.
get [kStreamOptions]() {
Expand All @@ -1702,7 +1706,11 @@ class QuicSession extends EventEmitter {
const state = this[kInternalState];
state.qlogStream = stream;
process.nextTick(() => {
this.emit('qlog', state.qlogStream);
try {
this.emit('qlog', state.qlogStream);
} catch (error) {
this.destroy(error);
}
});
}

Expand Down

0 comments on commit 16b32ea

Please sign in to comment.