@@ -399,7 +399,7 @@ dio.interceptors.add(InterceptorsWrapper(
399
399
400
400
``` dart
401
401
tokenDio = Dio(); //Create a instance to request the token.
402
- tokenDio.options = dio;
402
+ tokenDio.options = dio.options ;
403
403
dio.interceptors.add(InterceptorsWrapper(
404
404
onRequest:(Options options) async {
405
405
// If no token, request token firstly and lock this interceptor
@@ -503,11 +503,12 @@ dio.interceptors.add(LogInterceptor(responseBody: false)); //开启请求日志
503
503
504
504
``` dart
505
505
{
506
- /// 响应信息, 如果错误发生在在服务器返回数据之前,它为 `null`
507
- Response response ;
506
+ /// Request info.
507
+ RequestOptions request ;
508
508
509
- /// 错误描述.
510
- String message;
509
+ /// Response info, it may be `null` if the request can't reach to
510
+ /// the http server, for example, occurring a dns error, network is not available.
511
+ Response response;
511
512
512
513
/// 错误类型,见下文
513
514
DioErrorType type;
@@ -521,21 +522,21 @@ dio.interceptors.add(LogInterceptor(responseBody: false)); //开启请求日志
521
522
522
523
``` dart
523
524
enum DioErrorType {
524
- /// When opening url timeout, it occurs .
525
+ /// It occurs when url is opened timeout .
525
526
CONNECT_TIMEOUT,
526
527
527
- /// Whenever more than [receiveTimeout] (in milliseconds) passes between two events from response stream,
528
- /// [Dio] will throw the [DioError] with [DioErrorType.RECEIVE_TIMEOUT].
529
- ///
530
- /// Note: This is not the receiving time limitation .
528
+ /// It occurs when url is sent timeout.
529
+ SEND_TIMEOUT,
530
+
531
+ ///It occurs when receiving timeout .
531
532
RECEIVE_TIMEOUT,
532
533
533
534
/// When the server response, but with a incorrect status, such as 404, 503...
534
535
RESPONSE,
535
536
536
537
/// When the request is cancelled, dio will throw a error with this type.
537
538
CANCEL,
538
-
539
+
539
540
/// Default error type, Some other Error. In this case, you can
540
541
/// read the DioError.error if it is not null.
541
542
DEFAULT
0 commit comments