DioError class
DioError describes the exception info when a request failed.
- Implemented types
Constructors
- DioError({required RequestOptions requestOptions, Response? response, DioErrorType type = DioErrorType.unknown, Object? error, StackTrace? stackTrace, String? message})
- Prefer using one of the other constructors. They're most likely better fitting.
- DioError.badResponse({required int statusCode, required RequestOptions requestOptions, required Response response})
-
factory
- DioError.connectionError({required RequestOptions requestOptions, required String reason})
-
factory
- DioError.connectionTimeout({required Duration timeout, required RequestOptions requestOptions, Object? error})
-
factory
- DioError.receiveTimeout({required Duration timeout, required RequestOptions requestOptions, Object? error})
-
factory
- DioError.requestCancelled({required RequestOptions requestOptions, required Object? reason, StackTrace? stackTrace})
-
factory
- DioError.sendTimeout({required Duration timeout, required RequestOptions requestOptions})
-
factory
Properties
- error → Object?
-
The original error/exception object;
It's usually not null when
type
is DioErrorType.unknown.final - hashCode → int
-
The hash code for this object.
read-onlyinherited
- message → String?
-
The error message that throws a DioError.
final
- requestOptions → RequestOptions
-
The request info for the request that throws exception.
final
- response → Response?
-
Response info, it may be
null
if the request can't reach to the HTTP server, for example, occurring a DNS error, network is not available.final - runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- stackTrace → StackTrace
-
The stacktrace of the original error/exception object;
It's usually not null when
type
is DioErrorType.unknown.final - type → DioErrorType
-
final
Methods
-
copyWith(
{RequestOptions? requestOptions, Response? response, DioErrorType? type, Object? error, StackTrace? stackTrace, String? message}) → DioError - Generate a new DioError by combining given values and original values.
-
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.
inherited