You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
on the creation of a ContractExecutionError that extends a Web3ContractError (that ultimately extends an Error) the code starts the super class (eventually starting the Error) with a pre-defined message ("Error happened while trying to execute a function inside a smart contract") and appends the original error in a innerError prop.
This causes a deviance from Error handling standards, as a developer I'd like to know the actual stack and error message, and cause, that came along.
I propose to use the cause standard and call super('message', {cause: rpcError})
The text was updated successfully, but these errors were encountered:
moshmage
changed the title
web3js overrides transaction error object, escaping the standard
web3js deviates from the Error handling standard
Aug 28, 2023
on the creation of a
ContractExecutionError
that extends aWeb3ContractError
(that ultimately extends anError
) the code starts thesuper
class (eventually starting theError
) with a pre-defined message ("Error happened while trying to execute a function inside a smart contract") and appends the original error in ainnerError
prop.This causes a deviance from Error handling standards, as a developer I'd like to know the actual stack and error message, and cause, that came along.
I propose to use the cause standard and call
super('message', {cause: rpcError})
Expected behavior
{cause: error}
Actual behavior
innerError
Steps to reproduce the behavior
Check this line, https://github.com/web3/web3.js/blob/4.x/packages/web3-errors/src/errors/contract_errors.ts#L222
Environment
The text was updated successfully, but these errors were encountered: