Optional causeBelow ES2022, Error has no cause.
Adding it here as fallback so it is still accessible.
Readonly codeReadonly originalReadonly reasonOptional stackStatic Readonly MAKE_List of error handlers to lookup.
This list can be overridden to have a custom behavior. We recommend to only add new handler to this list.
Static USE_Static Optional prepareOptional override for formatting stack traces
Optional override for formatting stack traces
Static stackStatic captureStatic errorStatic handleHandle the error, using EthersJsError.MAKE_ERROR_CALLBACKS
the error to process.
The handlers in EthersJsError.MAKE_ERROR_CALLBACKS are iterated, used to process the err, and when an non-null (non-undefined) result is returned, the process finish.
If all handlers return undefined for the given err, This class (EthersJsError)
is used to wrap the error.
Static isGenerated using TypeDoc
Custom error class for Ethers.js
Remarks
Ethers.js doesn't have a custom error class, which errs the error to be thrown as Error, that is hard to debug/show in the UI. So we create a custom error class to wrap the error with readable error message.
See
https://github.com/ethers-io/ethers.js/blob/01b5badbb616b29fd8b69ef7c3cc3833062da3d7/packages/logger/src.ts/index.ts#L197