mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Catch CertificateException and HandshakeException
This commit is contained in:
parent
4e22f34dd1
commit
57911136e8
1 changed files with 15 additions and 0 deletions
15
lib/api.dart
15
lib/api.dart
|
|
@ -565,6 +565,11 @@ class InvenTreeAPI {
|
|||
print("TimeoutException at ${url}");
|
||||
showTimeoutError();
|
||||
return;
|
||||
} on HandshakeException catch (error) {
|
||||
print("HandshakeException at ${url}:");
|
||||
print(error.toString());
|
||||
showServerError(L10().serverCertificateError, error.toString());
|
||||
return;
|
||||
} catch (error, stackTrace) {
|
||||
print("Server error at ${url}: ${error.toString()}");
|
||||
showServerError(L10().serverError, error.toString());
|
||||
|
|
@ -815,6 +820,16 @@ class InvenTreeAPI {
|
|||
print("TimeoutException at ${url}");
|
||||
showTimeoutError();
|
||||
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) {
|
||||
print("Server error at ${url}: ${error.toString()}");
|
||||
showServerError(L10().serverError, error.toString());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue