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

Inconsistent thrown errors between provider protocols #5838

Closed
1 task done
spacesailor24 opened this issue Feb 15, 2023 · 0 comments
Closed
1 task done

Inconsistent thrown errors between provider protocols #5838

spacesailor24 opened this issue Feb 15, 2023 · 0 comments
Assignees
Labels
4.x 4.0 related Bug Addressing a bug

Comments

@spacesailor24
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

const transaction: Transaction = {
	from: tempAcc.address,
	to: '0x0000000000000000000000000000000000000000',
	value: BigInt(99999999999999999999999999999999999999999999999999999999999999),
}
try {
	await web3Eth.sendTransaction(transaction).on('error', error => console.log(error));
} catch (error) {
	console.log(error)
}

Throws for HTTP:

InvalidResponseError: Returned error: insufficient funds for transfer
      {
        innerError: { code: -32000, message: 'insufficient funds for transfer' },
        code: 101,
        data: undefined
      }

Throws for WS or IPC:

ResponseError: Returned error: insufficient funds for transfer
      {
        innerError: undefined,
        code: 100,
        data: undefined
      }

Expected Behavior

Thrown errors to be same

Steps to Reproduce

const transaction: Transaction = {
	from: tempAcc.address,
	to: '0x0000000000000000000000000000000000000000',
	value: BigInt(99999999999999999999999999999999999999999999999999999999999999),
}
try {
	await web3Eth.sendTransaction(transaction).on('error', error => console.log(error));
} catch (error) {
	console.log(error)
}

Web3.js Version

4.x

Environment

  • Operating System:
  • Browser:
  • Node.js Version:
  • NPM Version:

Anything Else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related Bug Addressing a bug
Projects
None yet
Development

No branches or pull requests

1 participant