the type of the error to be generated.
the callback type. It is used for both determine and transformation.
Return undefined
in this callback to signify that the information does not
form the desired contract error type.
the callback.
Readonly
createthe callback.
For the case of JsonRpcProvider, the error is highly nested. Even in their source code they need to dig the data up. This function only mimic that behavior. https://github.com/ethers-io/ethers.js/blob/44cbc7fa4e199c1d6113ceec3c5162f53def5bb8/packages/providers/src.ts/json-rpc-provider.ts#L25
Generated using TypeDoc
Get the information of the Contract error and create the corresponding Error object.
Remarks
The Error thrown by ethersjs is very cryptic, as they do not have a custom error type. To handle the error, they even need to dig in the error to find the correct information. This class uses the same algorithm to get the information (such as the error selector and byte code of the parameters). The information will then be passed to the custom callback to determine and generate the desired Error object.