# Error Handling Guide This guide explains how to implement consistent error handling with retry/cancel dialogs across Android and iOS apps. ## Android (Compose) ### Components Available 1. **ErrorDialog** - Reusable Material3 AlertDialog with retry/cancel buttons 2. **ApiResultHandler** - Composable that automatically handles ApiResult states 3. **HandleErrors()** - Extension function for ApiResult states ### Usage Examples See full documentation in the file for complete examples of: - Using ApiResultHandler for data loading screens - Using HandleErrors() extension for create/update/delete operations - Using ErrorDialog directly for custom scenarios ## iOS (SwiftUI) ### Components Available 1. **ErrorAlertModifier** - View modifier that shows error alerts 2. **ViewStateHandler** - View that handles loading/error/success states 3. **handleErrors()** - View extension for automatic error monitoring ### Usage Examples See full documentation for examples of each approach. ## Files Reference **Android:** - `composeApp/src/commonMain/kotlin/com/example/mycrib/ui/components/ErrorDialog.kt` - `composeApp/src/commonMain/kotlin/com/example/mycrib/ui/components/ApiResultHandler.kt` **iOS:** - `iosApp/iosApp/Helpers/ErrorAlertModifier.swift` - `iosApp/iosApp/Helpers/ViewStateHandler.swift`