Cross-platform error handling