Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

偶尔不抛异常,导致应用卡在加载状态 #1269

Closed
ghost opened this issue Sep 7, 2021 · 7 comments
Closed

偶尔不抛异常,导致应用卡在加载状态 #1269

ghost opened this issue Sep 7, 2021 · 7 comments

Comments

@ghost
Copy link

ghost commented Sep 7, 2021

我用的Future的 catchError
网络不好的时候 该抛给我的异常 没抛给我 直接打印在了控制台里
似乎是Dio 自己把异常处理了? 然后不告诉我?
让我的应用直接卡在加载状态 除了重启以外就没法再刷新


在网络稳定的情况下几乎永远不会发生这个问题
想复现得看运气 但是次数多了总会出现这个问题

@jgoyvaerts
Copy link
Contributor

Can you copy paste the error which is printed in the console here?
您可以复制粘贴控制台中打印的错误吗?

@ghost
Copy link
Author

ghost commented Sep 8, 2021

Can you copy paste the error which is printed in the console here?
您可以复制粘贴控制台中打印的错误吗?
May be similar to #377
可能类似于 #377

@ghost
Copy link
Author

ghost commented Sep 9, 2021

Can you copy paste the error which is printed in the console here?
您可以复制粘贴控制台中打印的错误吗?

E/flutter (20610): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: DioError [DioErrorType.other]: HttpException: Connection closed before full header was received, uri = 
E/flutter (20610): #0      DioMixin.assureDioError (package:dio/src/dio_mixin.dart:819:20)
E/flutter (20610): #1      DioMixin._dispatchRequest (package:dio/src/dio_mixin.dart:678:13)
E/flutter (20610): <asynchronous suspension>
E/flutter (20610): #2      DioMixin.fetch.<anonymous closure>.<anonymous closure> (package:dio/src/dio_mixin.dart)
E/flutter (20610): <asynchronous suspension>
E/flutter (20610): 
E/flutter (20610): #0      DioMixin.fetch.<anonymous closure> (package:dio/src/dio_mixin.dart:618:7)
E/flutter (20610): #1      _rootRunBinary (dart:async/zone.dart:1452:47)
E/flutter (20610): #2      _CustomZone.runBinary (dart:async/zone.dart:1342:19)
E/flutter (20610): #3      _FutureListener.handleError (dart:async/future_impl.dart:175:22)
E/flutter (20610): #4      Future._propagateToListeners.handleError (dart:async/future_impl.dart:779:47)
E/flutter (20610): #5      Future._propagateToListeners (dart:async/future_impl.dart:800:13)
E/flutter (20610): #6      Future._completeError (dart:async/future_impl.dart:610:5)
E/flutter (20610): #7      _SyncCompleter._completeError (dart:async/future_impl.dart:61:12)
E/flutter (20610): #8      _Completer.completeError (dart:async/future_impl.dart:33:5)
E/flutter (20610): #9      Future.any.onError (dart:async/future.dart:466:45)
E/flutter (20610): #10     _rootRunBinary (dart:async/zone.dart:1452:47)
E/flutter (20610): #11     _CustomZone.runBinary (dart:async/zone.dart:1342:19)
E/flutter (20610): #12     _FutureListener.handleError (dart:async/future_impl.dart:175:22)
E/flutter (20610): #13     Future._propagateToListeners.handleError (dart:async/future_impl.dart:779:47)
E/flutter (20610): #14     Future._propagateToListeners (dart:async/future_impl.dart:800:13)
E/flutter (20610): #15     Future._completeError (dart:async/future_impl.dart:610:5)
E/flutter (20610): #16     Future._asyncCompleteError.<anonymous closure> (dart:async/future_impl.dart:666:7)
E/flutter (20610): #17     _rootRun (dart:async/zone.dart:1428:13)
E/flutter (20610): #18     _CustomZone.run (dart:async/zone.dart:1328:19)
E/flutter (20610): #19     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
E/flutter (20610): #20     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
E/flutter (20610): #21     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter (20610): #22     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
E/flutter (20610): 

@wendux
Copy link
Contributor

wendux commented Oct 27, 2021

你是不是有自定义的拦截器,在onError方法中没有调用handler.next

@ghost
Copy link

ghost commented Oct 27, 2021

你是不是有自定义的拦截器,在onError方法中没有调用handler.next

我也有这个问题 我也确实在onError里调用了handler.next

@wendux
Copy link
Contributor

wendux commented Nov 19, 2021

用4.0.3试试呢?

@oruclu
Copy link

oruclu commented Dec 27, 2022

i am facing the same problem!
My console:

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: DioError [DioErrorType.other]: HttpException: Connection closed before full header was received, uri =

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants