Type guard to check if a JSBridge response is an error (4xx or 5xx status codes).
The JSBridge response to check
True if the response is any error (4xx or 5xx), false otherwise
const response = await someBridgeMethod();if (isError(response)) { // response narrowed to error variants — error: string is guaranteed console.error('Error:', response.error);} else { console.log('Success!');} Copy
const response = await someBridgeMethod();if (isError(response)) { // response narrowed to error variants — error: string is guaranteed console.error('Error:', response.error);} else { console.log('Success!');}
Type guard to check if a JSBridge response is an error (4xx or 5xx status codes).