Skip to content

Commit

Permalink
Fix catch exception
Browse files Browse the repository at this point in the history
  • Loading branch information
scroollocker committed Jun 7, 2019
1 parent 948243d commit 7c67137
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions package_src/lib/src/dio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,13 @@ class Dio {
if (cancelToken == null || !cancelToken.isCancelled) {
subscription.resume();
}
}).catchError((derr) async {
try {
await subscription.cancel();

} finally {
completer.completeError(_assureDioError(derr));
}
});
},
onDone: () async {
Expand Down

0 comments on commit 7c67137

Please sign in to comment.