FlintError class

Represents an error returned by the Flint client.

Implemented types

Constructors

FlintError(String message, {int? statusCode, dynamic originalException, Uri? url, String? method, DateTime? timestamp})
Creates a new FlintError with the given message.
FlintError.fromException(dynamic exception, {int? statusCode, Uri? url, String? method})
Creates a FlintError from another exception.
factory
FlintError.fromHttpResponse(HttpClientResponse response, {String? customMessage, Uri? url, String? method})
Creates a FlintError from an HTTP response.
factory
FlintError.fromMap(Map<String, dynamic> map)
Creates an error from a map.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
isClientError bool
Whether this error represents a client error (4xx status code).
no setter
isNetworkError bool
Whether this error represents a network error (no response received).
no setter
isRateLimit bool
Whether this error represents a rate limit (429 Too Many Requests).
no setter
isRetryable bool
Whether this error should be retried based on common retry patterns.
no setter
isServerError bool
Whether this error represents a server error (5xx status code).
no setter
isTimeout bool
Whether this error represents a timeout.
no setter
message String
The error message describing what went wrong.
final
method String?
The HTTP method that was being used when the error occurred.
final
originalException → dynamic
The original exception that caused this error, if any.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int?
The HTTP status code if this error came from an HTTP response.
final
timestamp DateTime
The timestamp when the error occurred.
final
url Uri?
The URL that was being requested when the error occurred.
final

Methods

copyWith({String? message, int? statusCode, dynamic originalException, Uri? url, String? method, DateTime? timestamp}) FlintError
Creates a copy of this error with optional overrides.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Converts the error to a map for serialization.
toString() String
A string representation of this object.
override

Operators

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