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.
const
DioError.badResponse({required int statusCode, required RequestOptions requestOptions, required Response? response})
const
DioError.connectionError({required RequestOptions requestOptions, required String reason})
const
DioError.connectionTimeout({required Duration timeout, required RequestOptions requestOptions, Object? error, StackTrace? stackTrace})
const
DioError.receiveTimeout({required Duration timeout, required RequestOptions requestOptions, StackTrace? stackTrace})
const
DioError.requestCancelled({required RequestOptions requestOptions, required Object? reason, StackTrace? stackTrace})
const
DioError.sendTimeout({required Duration timeout, required RequestOptions requestOptions})
const

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.
no setterinherited
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.
no setterinherited
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