ApiError class

Structured error details returned by an HTTP API error response.

Constructors

ApiError({Object? code, String? message, Object? status, List<Map<String, dynamic>>? details})
Creates an ApiError.
const
ApiError.fromJson(Map<String, dynamic> json)
Creates an ApiError from a JSON map.
factory

Properties

code → Object?
Numeric HTTP/RPC status code or symbolic error identifier.
final
details → List<Map<String, dynamic>>?
Additional structured error details.
final
hashCode → int
The hash code for this object.
no setterinherited
message → String?
Developer-facing error message from the backend.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status → Object?
Symbolic status code (for example, 'INVALID_ARGUMENT').
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this ApiError to a JSON map.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

tryParseEnvelope(String body) → ApiError?
Attempts to parse an {"error": {...}} JSON envelope from body.