isSolanaError
Call Signature
A type guard that returns true if the input is a SolanaError, optionally with a
particular error code.
When the code argument is supplied and the input is a SolanaError, TypeScript will
refine the error's `context` property to the type associated with
that error code. You can use that context to render useful error messages, or to make
context-aware decisions that help your application to recover from the error.
Type Parameters
| Type Parameter |
|---|
TErrorCode extends 7618003 |
Parameters
| Parameter | Type |
|---|---|
e | unknown |
code | TErrorCode |
Returns
e is SolanaErrorWithDeprecatedCause<TErrorCode>
Example
Call Signature
A type guard that returns true if the input is a SolanaError, optionally with a
particular error code.
When the code argument is supplied and the input is a SolanaError, TypeScript will
refine the error's `context` property to the type associated with
that error code. You can use that context to render useful error messages, or to make
context-aware decisions that help your application to recover from the error.
Type Parameters
| Type Parameter |
|---|
TErrorCode extends SolanaErrorCode |
Parameters
| Parameter | Type |
|---|---|
e | unknown |
code? | TErrorCode |
Returns
e is SolanaError<TErrorCode>