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

    Function isClientError

    • Type guard to check if a JSBridge response is a client error (4xx status codes).

      Type Parameters

      Parameters

      • response: T

        The JSBridge response to check

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

      True if the response is a client error (400, 401, 403, 404, 424, 426), false otherwise

      const response = await someBridgeMethod();
      if (isClientError(response)) {
      console.error('Client error:', response.error);
      }