Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
quic: handle unhandled rejections on QuicSession
  • Loading branch information
jasnell committed Jul 16, 2020
commit fcfa129eec3977ffb2f00a7c2f7a4950bfdcd746
10 changes: 9 additions & 1 deletion lib/internal/quic/core.js
Original file line number Diff line number Diff line change
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