APIException class

Custom exception class for API errors.

Implemented types

Constructors

APIException(String message, {int? statusCode, Exception? innerException})

Properties

error → Object?
The original error/exception object; It's usually not null when type is DioExceptionType.unknown.
no setter
hashCode → int
The hash code for this object.
no setterinherited
innerException → Exception?
final
message → String
The error message that throws a DioException.
final
requestOptions → RequestOptions
The request info for the request that throws exception.
no setter
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.
no setter
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 DioExceptionType.unknown.
no setter
statusCode → int?
final
stringBuilder ↔ DioExceptionReadableStringBuilder?
Each exception can be override with a customized builder or fallback to the default DioException.readableStringBuilder.
getter/setter pair
type → DioExceptionType
no setter

Methods

copyWith({RequestOptions? requestOptions, Response? response, DioExceptionType? type, Object? error, StackTrace? stackTrace, String? message}) → DioException
Generate a new DioException 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