isSdkUnauthorizedError
Checks if the given error was caused by SDKError and its status code is 401, indicating an unauthorized request error.
Signature
isSdkUnauthorizedError: (
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 an unauthorized request error caused by SDKError.
Referenced Types
Examples
catch (error) {
if (isSdkUnauthorizedError(error)) {
// handle unauthorized error
}
}