AppError class abstract
Abstract base class for all application errors.
Provides a common interface for typed, structured error handling. All errors carry a slug (machine-readable identifier), a msg (human-readable message), and an optional stackTrace.
Preset concrete subclasses cover the most common error domains:
- HttpError — HTTP request failures (network, status codes, etc.)
- CacheError — Local cache read/write failures
- DeviceInfoError — Device information retrieval failures
- FormError — Form validation and submission failures
- StorageError — Device storage access failures
General-purpose subclasses are also provided:
- AppUnknownError — Unexpected or unclassified errors
- ParseError — Data parsing or deserialization failures
- EntityNotFitError — Domain rule or constraint violations
- FailedToShareError — Content-sharing failures
- TokenNotFoundError — Authentication token not found
See also ValueError for value-validation errors, and the corresponding ParseException / CacheException for thrown exception counterparts.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- msg → String
-
A human-readable description of this error.
final
- payload → Object?
-
An optional payload containing additional data associated with this error.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- slug → String
-
A machine-readable identifier for this error (e.g.
'user_not_found').final - stackTrace → String
-
The stack trace associated with this error, if available.
final
Methods
-
maybeResponse<
T> () → Maybe< T> -
If this error is an HttpError<T>, returns
Justwith its typed response body; otherwise returnsNothing. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override