* Get an Ethereum Provider error class instance. * * @param code - The error code. * @param arg - The error message or options bag. * @returns An instance of the EthereumProviderError class.
( code: number, arg?: JsonRpcErrorsArg<Data>, )
| 264 | * @returns An instance of the {@link EthereumProviderError} class. |
| 265 | */ |
| 266 | function getEthProviderError<Data extends OptionalDataWithOptionalCause>( |
| 267 | code: number, |
| 268 | arg?: JsonRpcErrorsArg<Data>, |
| 269 | ): EthereumProviderError<Data> { |
| 270 | const [message, data] = parseOpts(arg); |
| 271 | return new EthereumProviderError( |
| 272 | code, |
| 273 | message ?? getMessageFromCode(code), |
| 274 | data, |
| 275 | ); |
| 276 | } |
| 277 | |
| 278 | /** |
| 279 | * Get an error message and optional data from an options bag. |
no test coverage detected
searching dependent graphs…