mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-09 17:39:42 +00:00
refactor(linter): Change DioError to DioException
This commit is contained in:
parent
2f6b4e0f9c
commit
02a2097b10
|
@ -103,7 +103,7 @@ class BackblazeApi extends RestApiMap {
|
||||||
} else {
|
} else {
|
||||||
throw Exception('code: ${response.statusCode}');
|
throw Exception('code: ${response.statusCode}');
|
||||||
}
|
}
|
||||||
} on DioError catch (e) {
|
} on DioException catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
return GenericResult(
|
return GenericResult(
|
||||||
data: false,
|
data: false,
|
||||||
|
|
|
@ -144,7 +144,7 @@ class CloudflareApi extends RestApiMap {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
await Future.wait(allCreateFutures);
|
await Future.wait(allCreateFutures);
|
||||||
} on DioError catch (e) {
|
} on DioException catch (e) {
|
||||||
print(e.message);
|
print(e.message);
|
||||||
rethrow;
|
rethrow;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -133,7 +133,7 @@ class DigitalOceanDnsApi extends RestApiMap {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
await Future.wait(allCreateFutures);
|
await Future.wait(allCreateFutures);
|
||||||
} on DioError catch (e) {
|
} on DioException catch (e) {
|
||||||
print(e.message);
|
print(e.message);
|
||||||
rethrow;
|
rethrow;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ abstract class RestApiMap {
|
||||||
|
|
||||||
dio.interceptors.add(
|
dio.interceptors.add(
|
||||||
InterceptorsWrapper(
|
InterceptorsWrapper(
|
||||||
onError: (final DioError e, final ErrorInterceptorHandler handler) {
|
onError: (final DioException e, final ErrorInterceptorHandler handler) {
|
||||||
print(e.requestOptions.path);
|
print(e.requestOptions.path);
|
||||||
print(e.requestOptions.data);
|
print(e.requestOptions.data);
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class ConsoleInterceptor extends InterceptorsWrapper {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> onError(
|
Future<void> onError(
|
||||||
final DioError err,
|
final DioException err,
|
||||||
final ErrorInterceptorHandler handler,
|
final ErrorInterceptorHandler handler,
|
||||||
) async {
|
) async {
|
||||||
final Response? response = err.response;
|
final Response? response = err.response;
|
||||||
|
|
|
@ -87,7 +87,7 @@ class HetznerApi extends RestApiMap {
|
||||||
final String stagingAcme = TlsOptions.stagingAcme ? 'true' : 'false';
|
final String stagingAcme = TlsOptions.stagingAcme ? 'true' : 'false';
|
||||||
Response? serverCreateResponse;
|
Response? serverCreateResponse;
|
||||||
HetznerServerInfo? serverInfo;
|
HetznerServerInfo? serverInfo;
|
||||||
DioError? hetznerError;
|
DioException? hetznerError;
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
|
@ -117,7 +117,7 @@ class HetznerApi extends RestApiMap {
|
||||||
serverCreateResponse.data['server'],
|
serverCreateResponse.data['server'],
|
||||||
);
|
);
|
||||||
success = true;
|
success = true;
|
||||||
} on DioError catch (e) {
|
} on DioException catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
hetznerError = e;
|
hetznerError = e;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in a new issue