@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

      • T

      Parameters

      Returns response is BridgeClientError

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

      const response = await someBridgeMethod();
      if (isClientError(response)) {
      // response is narrowed to BridgeClientError
      console.error('Client error:', response.error);
      }