Skip to content

Commit 7c67137

Browse files
committed
Fix catch exception
1 parent 948243d commit 7c67137

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

package_src/lib/src/dio.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,13 @@ class Dio {
490490
if (cancelToken == null || !cancelToken.isCancelled) {
491491
subscription.resume();
492492
}
493+
}).catchError((derr) async {
494+
try {
495+
await subscription.cancel();
496+
497+
} finally {
498+
completer.completeError(_assureDioError(derr));
499+
}
493500
});
494501
},
495502
onDone: () async {

0 commit comments

Comments
 (0)