fix potential network issue

This commit is contained in:
2024-11-13 19:28:47 +08:00
parent 194abb82de
commit dd7154830b

View File

@@ -206,7 +206,8 @@ class AppDio with DioMixin {
: rhttp.ProxySettings.proxy(proxy!), : rhttp.ProxySettings.proxy(proxy!),
)); ));
} }
var res = super.request<T>( try {
return super.request<T>(
path, path,
data: data, data: data,
queryParameters: queryParameters, queryParameters: queryParameters,
@@ -215,10 +216,12 @@ class AppDio with DioMixin {
onSendProgress: onSendProgress, onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
}
finally {
if(_requests.containsKey(path)) { if(_requests.containsKey(path)) {
_requests.remove(path); _requests.remove(path);
} }
return res; }
} }
} }