Type guard to check if the error is an API error.
The error to check.
try { ...}catch (error) { if (isApiError(error)) { // Handle API error console.log(error.errorMessage); }} Copy
try { ...}catch (error) { if (isApiError(error)) { // Handle API error console.log(error.errorMessage); }}
Type guard to check if the error is an API error.