BaseApiException class sealed
- Available extensions
- Annotations
-
- @freezed
Constructors
- BaseApiException.badCertificate()
-
由
ValidateCertificate
配置的证书不正确引起constfactory - BaseApiException.badResponse({@igFreezedJson Response? response, int? statusCode})
-
服务器错误
constfactory
- BaseApiException.businessException({required String message, @igFreezedJson Object? error, @igFreezedJson StackTrace? stackTrace})
-
constfactory
- BaseApiException.cancel({@igFreezedJson Object? error, @igFreezedJson RequestOptions? options})
-
请求被主动关闭异常
constfactory
- BaseApiException.connectionError()
-
例如由“xhr.onError”或SocketExceptions引起。
constfactory
- BaseApiException.connectionTimeout()
-
由连接超时引起的异常
constfactory
- BaseApiException.createFromDioException(DioException dioException)
-
factory
-
BaseApiException.fromJson(Map<
String, dynamic> json) -
factory
- BaseApiException.receiveTimeout()
-
它发生在接收超时时。
constfactory
- BaseApiException.sendTimeout()
-
当url发送超时时会发生这种情况。
constfactory
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
Aswitch
-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 ofmap
that fallback to returningnull
. -
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 ofmap
that fallback to returningorElse
. -
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 ofwhen
that fallback to anorElse
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
Aswitch
-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 ofwhen
that fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited