@grabjs/superapp-sdk
    Preparing search index...

    Function isClientError

    • Type guard to check if an SDK response has a client error status code (400, 401, 403, 404, 424, 426).

      Type Parameters

      Parameters

      • response: T

        The SDK response to check

      Returns response is Extract<T, { status_code: 400 | 401 | 403 | 404 | 424 | 426 }>

      true if the response is a client error, false otherwise

      const response = await someBridgeMethod();
      if (isClientError(response)) {
      // response narrowed to client error variants, `error` is available
      console.error(response.error);
      }