HttpFailureKind enum
Describes the general kind of HTTP failure.
HttpFailureKind is used to classify HTTP-related failures into
predictable categories. This makes it easier to handle different network
and response failure cases without depending directly on a specific HTTP
client exception type.
Values
- badResponse → const HttpFailureKind
-
The server returned a response, but the response is considered invalid or unsuccessful.
This usually represents non-success HTTP status codes or responses that the application decided to treat as failures.
- connectionTimeout → const HttpFailureKind
-
The connection could not be established before the connection timeout was reached.
- sendTimeout → const HttpFailureKind
-
The request could not be sent before the send timeout was reached.
- receiveTimeout → const HttpFailureKind
-
The response was not received before the receive timeout was reached.
- badCertificate → const HttpFailureKind
-
The request failed because of an invalid, rejected, or untrusted certificate.
- cancelled → const HttpFailureKind
-
The request was cancelled before it completed.
- connectionError → const HttpFailureKind
-
The request failed because of a network connection problem.
This can include cases such as no internet connection, DNS failure, socket failure, or another lower-level connection issue.
- unknown → const HttpFailureKind
-
The HTTP failure could not be classified into one of the known kinds.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - 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.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
HttpFailureKind> - A constant List of the values in this enum, in order of their declaration.