Alokai

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 ErrorCausedBySDKError

Parameters

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

On this page