Skip to content

Commit

Permalink
not required msg var removed in errors.ConnectionCloseError
Browse files Browse the repository at this point in the history
  • Loading branch information
nivida committed Jan 29, 2020
1 parent 319710d commit 46ebb24
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/web3-core-helpers/src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,16 @@ module.exports = {
return this.ConnectionError('connection not open on send()', event);
},
ConnectionCloseError: function (event){
let msg = 'CONNECTION ERROR: The connection closed unexpectedly';

if (typeof event === 'object' && event.code && event.reason) {
msg = 'CONNECTION ERROR: The connection got closed with ' +
return this.ConnectionError(
'CONNECTION ERROR: The connection got closed with ' +
'the close code `' + event.code + '` and the following ' +
'reason string `' + event.reason + '`';

return this.ConnectionError(msg, event);
'reason string `' + event.reason + '`',
event
);
}

return new Error(msg);
return new Error('CONNECTION ERROR: The connection closed unexpectedly');
},
MaxAttemptsReachedOnReconnectingError: function (){
return new Error('Maximum number of reconnect attempts reached!');
Expand Down

0 comments on commit 46ebb24

Please sign in to comment.