-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled Promise Rejection on 'sendRequest' #2062
Labels
Bug
Addressing a bug
Comments
This will be fixed with the PR #2000 |
This is fixed since beta.38. |
Closed
nivida
pushed a commit
that referenced
this issue
Oct 8, 2019
* Bubble up tx signing errors Resolves #2062
nachomazzara
pushed a commit
to nachomazzara/web3.js
that referenced
this issue
Jun 4, 2020
* Bubble up tx signing errors Resolves web3#2062
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When
.send()
'ing a contract method, web3 creates the handling logic, returns apromiEvent
and finally executes the call at:https://github.com/ethereum/web3.js/blob/0d54d94e637832abf97834e4fc444fbff87f874b/packages/web3-core-method/src/index.js#L581
Inside
sendRequest
, there is a call tosignTransaction
:https://github.com/ethereum/web3.js/blob/0d54d94e637832abf97834e4fc444fbff87f874b/packages/web3-core-method/src/index.js#L536
If for any reason the signing fails, i.e. the
net
API is not enabled in the underlying node,signTransaction
returns a failed promise that will be lost as the originalsendRequest
call does handle it (does not act ondefer
ordefer.eventEmitter
).The result is an
Unhandled Promise Rejection
error and the web3 user code client hangs given thepromiEvent
does never emit even anerror
event.@nivida I'm happy to contribute with a fix/PR. Just wondering if you or @frozeman have any thoughts on the better way to handle this.
Issue #1220 is possibly related or similar to this.
The text was updated successfully, but these errors were encountered: