Alokai

isSdkServerError

Checks if the given error was caused by SDKError and its status code is between 500 and 600, indicating a server error.

Signature

isSdkServerError: (
	error: unknown
) => error is ErrorCausedBySDKError

Parameters

NameRequiredTypeDescription
errorRequiredunknownThe error to check.

Returns

A type predicate indicating whether the error is a server error caused by SDKError.

Referenced Types

Examples

catch (error) {
  if (isSdkServerError(error)) {
    // handle server error (show maintenance page, retry, etc.)
  }
}

On this page