CDP Frontend SDK
    Preparing search index...
    • Type guard to check if the error is an API error.

      Parameters

      • error: unknown

        The error to check.

      Returns error is APIError

      • True if the error is an API error, false otherwise.
      try {
      ...
      }
      catch (error) {
      if (isApiError(error)) {
      // Handle API error
      console.log(error.errorMessage);
      }
      }