Skip to content
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

Closed
gabmontes opened this issue Nov 22, 2018 · 2 comments
Closed

Unhandled Promise Rejection on 'sendRequest' #2062

gabmontes opened this issue Nov 22, 2018 · 2 comments
Assignees
Labels
Bug Addressing a bug
Projects

Comments

@gabmontes
Copy link
Contributor

When .send()'ing a contract method, web3 creates the handling logic, returns a promiEvent 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 to signTransaction:

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 original sendRequest call does handle it (does not act on defer or defer.eventEmitter).

The result is an Unhandled Promise Rejection error and the web3 user code client hangs given the promiEvent does never emit even an error 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.

gabmontes added a commit to bloq/web3.js that referenced this issue Nov 23, 2018
@nivida nivida added the Bug Addressing a bug label Nov 25, 2018
@nivida nivida added this to the 1.0 milestone Nov 25, 2018
@nivida nivida self-assigned this Nov 25, 2018
@nivida nivida added this to To do in 1.0 Nov 28, 2018
@nivida nivida modified the milestone: 1.0 Nov 30, 2018
@nivida
Copy link
Contributor

nivida commented Jan 22, 2019

This will be fixed with the PR #2000

@nivida
Copy link
Contributor

nivida commented Feb 7, 2019

This is fixed since beta.38.

@nivida nivida closed this as completed Feb 7, 2019
1.0 automation moved this from To do to Done Feb 7, 2019
gabmontes added a commit to bloq/web3.js that referenced this issue Oct 8, 2019
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
Labels
Bug Addressing a bug
Projects
No open projects
1.0
  
Done
Development

No branches or pull requests

2 participants