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

    Function isServerError

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

      Type Parameters

      • T

      Parameters

      Returns response is BridgeServerError

      True if the response is a server error (500, 501), false otherwise

      const response = await someBridgeMethod();
      if (isServerError(response)) {
      // response is narrowed to BridgeServerError
      console.error('Server error:', response.error);
      }