function isApiError(error: unknown): error is APIError;
error
unknown
error is APIError
try { ... } catch (error) { if (isApiError(error)) { // Handle API error console.log(error.errorMessage); } }
Was this page helpful?