Failure class
Represents a standardized base domain failure entity containing error information.
This class extends Equatable to facilitate structural comparisons across
layers (Data, Domain, Presentation) without relying on object identity.
Constructors
- Failure({required String message, Object? error, StackTrace? stackTrace})
-
Creates an immutable Failure instance.
const
Properties
- detailedMessage → String
-
Accumulates all available failure properties into a comprehensive, multiline diagnostic string.
no setter
- error → Object?
-
The underlying original exception or error object, if available.
final
- hashCode → int
-
Generates a hash code compound from the distinct values of message and error.
no setter
- message → String
-
A human-readable message describing the reason for the failure.
final
-
props
→ List<
Object?> -
Defines the list of properties utilized by
Equatablefor object state validation.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace?
-
The execution stack trace associated with the thrown exception for debugging.
final
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String - Returns the simplified message string.
Operators
-
operator ==(
Object other) → bool - Compares two Failure instances based on their value states rather than memory addresses.