Keep emitting the error as an object for Maximum number of reconnect attempts reached!
#5889
Closed
2 tasks done
Labels
Is there an existing issue for this?
Feature Request
At WebSocketProvider, the error when the reconnect attempt reached, was an object in version 1.x but now just an error sting.
In v1.x:
web3.js/packages/web3-providers-ws/src/index.js
Line 413 in d7fb27f
In 4.x:
web3.js/packages/web3-utils/src/socket_provider.ts
Line 243 in 8e44e88
And the error message was:
Maximum number of reconnect attempts reached!
But changed in v.4 to:
Max connection attempts exceeded (${this._reconnectOptions.maxAttempts})
I suggest keeping the old way of using an Error object and also keeping the old string to reduce breaking changes. However, we may add the number of max attempts at the end of the old error message.
Use Cases
Reduce breaking changes between 1.x and 4.x
Implementation Ideas
No response
Feature Examples/References
No response
Are you willing to implement this feature?
The text was updated successfully, but these errors were encountered: