Skip to content

Commit 573b26a

Browse files
authored
Merge pull request cfug#334 from scroollocker/fix-exception
Fix catch exception
2 parents 948243d + 7c67137 commit 573b26a

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)