mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 13:36:50 +00:00
Catch CertificateException and HandshakeException
This commit is contained in:
parent
4e22f34dd1
commit
57911136e8
15
lib/api.dart
15
lib/api.dart
@ -565,6 +565,11 @@ class InvenTreeAPI {
|
|||||||
print("TimeoutException at ${url}");
|
print("TimeoutException at ${url}");
|
||||||
showTimeoutError();
|
showTimeoutError();
|
||||||
return;
|
return;
|
||||||
|
} on HandshakeException catch (error) {
|
||||||
|
print("HandshakeException at ${url}:");
|
||||||
|
print(error.toString());
|
||||||
|
showServerError(L10().serverCertificateError, error.toString());
|
||||||
|
return;
|
||||||
} catch (error, stackTrace) {
|
} catch (error, stackTrace) {
|
||||||
print("Server error at ${url}: ${error.toString()}");
|
print("Server error at ${url}: ${error.toString()}");
|
||||||
showServerError(L10().serverError, error.toString());
|
showServerError(L10().serverError, error.toString());
|
||||||
@ -815,6 +820,16 @@ class InvenTreeAPI {
|
|||||||
print("TimeoutException at ${url}");
|
print("TimeoutException at ${url}");
|
||||||
showTimeoutError();
|
showTimeoutError();
|
||||||
return null;
|
return null;
|
||||||
|
} on CertificateException catch (error) {
|
||||||
|
print("CertificateException at ${url}:");
|
||||||
|
print(error.toString());
|
||||||
|
showServerError(L10().serverCertificateError, error.toString());
|
||||||
|
return null;
|
||||||
|
} on HandshakeException catch (error) {
|
||||||
|
print("HandshakeException at ${url}:");
|
||||||
|
print(error.toString());
|
||||||
|
showServerError(L10().serverCertificateError, error.toString());
|
||||||
|
return null;
|
||||||
} catch (error, stackTrace) {
|
} catch (error, stackTrace) {
|
||||||
print("Server error at ${url}: ${error.toString()}");
|
print("Server error at ${url}: ${error.toString()}");
|
||||||
showServerError(L10().serverError, error.toString());
|
showServerError(L10().serverError, error.toString());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user