Skip to content

Commit

Permalink
fix: setup on channel/connection closing/closed
Browse files Browse the repository at this point in the history
IllegalOperation is sent with different messages depending
on connection or channel is closing or closed. All errors should
cause a reconnect.
  • Loading branch information
luddd3 committed Aug 24, 2021
1 parent 7c5fe10 commit b21bd01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ChannelWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default class ChannelWrapper extends EventEmitter {
this._setups.map((setupFn) =>
// TODO: Use a timeout here to guard against setupFns that never resolve?
pb.call(setupFn, this, channel).catch((err) => {
if (err.name === 'IllegalOperationError' && err.message === 'Channel closed') {
if (err.name === 'IllegalOperationError') {
// Don't emit an error if setups failed because the channel closed.
return;
}
Expand Down

0 comments on commit b21bd01

Please sign in to comment.