GuardedApiException class

Exception thrown by guardedApiCall when a network response contains an ApiErrors value or when an unexpected exception occurs.

This is intentionally lightweight and app-agnostic so that each app can map it to its own domain failure type (e.g. NetworkFailure, UIError) in the repository or usecase layer.

Implemented types

Constructors

GuardedApiException(ApiErrors error, String message, {Map<String, dynamic>? data})
const

Properties

data Map<String, dynamic>?
Optional payload from the response (usually response['data']).
final
error ApiErrors
Normalized API error code.
final
hashCode int
The hash code for this object.
no setterinherited
message String
Human-readable message, already sanitized for user display.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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.
inherited