BaseApiException class sealed

Available extensions
Annotations
  • @freezed

Constructors

BaseApiException.badCertificate()
ValidateCertificate配置的证书不正确引起
const
factory
BaseApiException.badResponse({@igFreezedJson Response? response, int? statusCode})
服务器错误
const
factory
BaseApiException.businessException({required String message, @igFreezedJson Object? error, @igFreezedJson StackTrace? stackTrace})
const
factory
BaseApiException.cancel({@igFreezedJson Object? error, @igFreezedJson RequestOptions? options})
请求被主动关闭异常
const
factory
BaseApiException.connectionError()
例如由“xhr.onError”或SocketExceptions引起。
const
factory
BaseApiException.connectionTimeout()
由连接超时引起的异常
const
factory
BaseApiException.createFromDioException(DioException dioException)
factory
BaseApiException.fromJson(Map<String, dynamic> json)
factory
BaseApiException.receiveTimeout()
它发生在接收超时时。
const
factory
BaseApiException.sendTimeout()
当url发送超时时会发生这种情况。
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int?

Available on BaseApiException, provided by the BaseApiExceptionEx extension

no setter

Methods

map<TResult extends Object?>({required TResult cancel(BaseApiCancelException value), required TResult connectionTimeout(BaseApiConnectionTimeoutException value), required TResult sendTimeout(BaseApiSendTimeoutException value), required TResult receiveTimeout(BaseApiReceiveTimeoutException value), required TResult badCertificate(BaseApiBadCertificateException value), required TResult connectionError(BaseApiConnectionErrorException value), required TResult badResponse(BaseApiBadResponseException value), required TResult businessException(BaseApiBusinessException value)}) → TResult

Available on BaseApiException, provided by the BaseApiExceptionPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? cancel(BaseApiCancelException value)?, TResult? connectionTimeout(BaseApiConnectionTimeoutException value)?, TResult? sendTimeout(BaseApiSendTimeoutException value)?, TResult? receiveTimeout(BaseApiReceiveTimeoutException value)?, TResult? badCertificate(BaseApiBadCertificateException value)?, TResult? connectionError(BaseApiConnectionErrorException value)?, TResult? badResponse(BaseApiBadResponseException value)?, TResult? businessException(BaseApiBusinessException value)?}) → TResult?

Available on BaseApiException, provided by the BaseApiExceptionPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult cancel(BaseApiCancelException value)?, TResult connectionTimeout(BaseApiConnectionTimeoutException value)?, TResult sendTimeout(BaseApiSendTimeoutException value)?, TResult receiveTimeout(BaseApiReceiveTimeoutException value)?, TResult badCertificate(BaseApiBadCertificateException value)?, TResult connectionError(BaseApiConnectionErrorException value)?, TResult badResponse(BaseApiBadResponseException value)?, TResult businessException(BaseApiBusinessException value)?, required TResult orElse()}) → TResult

Available on BaseApiException, provided by the BaseApiExceptionPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>({TResult cancel(Object? error, RequestOptions? options)?, TResult connectionTimeout()?, TResult sendTimeout()?, TResult receiveTimeout()?, TResult badCertificate()?, TResult connectionError()?, TResult badResponse(Response? response, int? statusCode)?, TResult businessException(String message, Object? error, StackTrace? stackTrace)?, required TResult orElse()}) → TResult

Available on BaseApiException, provided by the BaseApiExceptionPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this BaseApiException to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
tryGetRequestOptions() → RequestOptions?

Available on BaseApiException, provided by the BaseApiExceptionEx extension

tryGetResponse() → Response?

Available on BaseApiException, provided by the BaseApiExceptionEx extension

when<TResult extends Object?>({required TResult cancel(Object? error, RequestOptions? options), required TResult connectionTimeout(), required TResult sendTimeout(), required TResult receiveTimeout(), required TResult badCertificate(), required TResult connectionError(), required TResult badResponse(Response? response, int? statusCode), required TResult businessException(String message, Object? error, StackTrace? stackTrace)}) → TResult

Available on BaseApiException, provided by the BaseApiExceptionPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>({TResult? cancel(Object? error, RequestOptions? options)?, TResult? connectionTimeout()?, TResult? sendTimeout()?, TResult? receiveTimeout()?, TResult? badCertificate()?, TResult? connectionError()?, TResult? badResponse(Response? response, int? statusCode)?, TResult? businessException(String message, Object? error, StackTrace? stackTrace)?}) → TResult?

Available on BaseApiException, provided by the BaseApiExceptionPatterns extension

A variant of when that fallback to returning null

Operators

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