Alokai

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 ErrorCausedBySDKError

Parameters

NameRequiredTypeDescription
errorRequiredunknownThe 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
  }
}

On this page