ApiError class

The normalised error type surfaced on ApiResponse.error.

This type is deliberately minimal: consumers commonly declare their own error model with implements ApiError, so every member added here becomes a breaking change for them. The original throwable and its stack trace are carried on ApiResponse.cause / ApiResponse.stackTrace instead.

Available extensions

Constructors

ApiError(String message, int code)

Properties

code → int
final
hashCode → int
The hash code for this object.
no setteroverride
hasHttpStatusCode → bool

Available on ApiError, provided by the ApiErrorStatus extension

True when ApiError.code falls in the range of a real HTTP status code, meaning it can meaningfully be surfaced as ApiResponse.statusCode.
no setter
message → String
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.
override