isSdkRequestError
Checks if the given error was caused by SDKError and its status code is between 400 and 500, indicating a client error.
Signature
isSdkRequestError: (
error: unknown
) => error is ErrorCausedBySDKErrorParameters
| Name | Required | Type | Description |
|---|---|---|---|
error | Required | unknown | The error to check. |
Returns
A type predicate indicating whether the error is a client error caused by SDKError.
Referenced Types
Examples
catch (error) {
if (isSdkRequestError(error)) {
// handle client error
}
}