app_failure library

Declarative failure handling for Dart and Flutter applications.

app_failure provides structured failure objects, layered failure chains, and lightweight result handling.

The package helps applications preserve failure context across layers instead of relying on hidden exception propagation.

Classes

ApiFailure
Represents a failure produced by an API layer.
AppFailure
Shared base class for all application failures.
AppFailureResult<T>
A failed AppResult.
AppResult<T>
Represents the result of an operation that can either succeed with data or fail with an AppFailure.
AppSuccess<T>
A successful AppResult.
ControllerFailure
HttpFailure
HttpFailureRequestModel
Stores HTTP request information related to a failure.
HttpFailureResponseModel
Stores HTTP response information related to a failure.
PerformanceFailure
PerformanceFailure - Represents slow or degraded operation. (silent error, design for logging or debugging) Example: operation exceeded expected time, timeout-like UX warning, benchmark alert.
PermissionFailure
PermissionFailure - permission denied/restricted/permanently denied Example: denied location permission, unauthorized action, missing role.
RepositoryFailure
UnhandledFailure
ValidationFailure
Represents a validation failure.

Enums

FatalLevel
Core failure model for the app_failure package.
HttpFailureKind
Describes the general kind of HTTP failure.