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:

General-purpose subclasses are also provided:

See also ValueError for value-validation errors, and the corresponding ParseException / CacheException for thrown exception counterparts.

Implementers

Constructors

AppError({String slug = '', String msg = '', String stackTrace = '', Object? payload})
const

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 Just with its typed response body; otherwise returns Nothing.
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