Class ContractErrorFactory<ErrorType, Fn>

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.

Type Parameters

  • ErrorType extends PendleSdkError

    the type of the error to be generated.

  • Fn extends ((hexStringData, ethersJsError) => ErrorType | undefined)

    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.

Constructors

Properties

Methods

Constructors

Properties

createErrorObject: Fn

the callback.

Methods

Generated using TypeDoc