ErrorResponseModel class

The structured error envelope returned by the My Fuel Orders backend on non-2xx responses, per driver-lite-openapi/driverlite.yaml's ErrorResponse schema.

Carries a machine-readable code, a human-readable message, a traceId for correlating a report with server-side logs, and optional per-field details for validation failures.

Inheritance

Constructors

ErrorResponseModel({required String code, required String message, required String traceId, List<ErrorDetail> details = const <ErrorDetail>[]})
const

Properties

code String
A machine-readable error code (e.g. VALIDATION_ERROR, TOO_MANY_REQUESTS).
final
details List<ErrorDetail>
Per-field validation errors, empty when the backend did not include any.
final
hashCode int
The hash code for this object.
no setterinherited
message String
A human-readable description of the error.
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
traceId String
The backend's request-trace identifier, for correlating this error with server-side logs.
final

Methods

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

Operators

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

Static Methods

tryFromJson(Map<String, dynamic> json) ErrorResponseModel?
Attempts to parse an ErrorResponseModel from a decoded error response body.