diff --git a/lib/api.dart b/lib/api.dart index edb4a279..30abfefd 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -349,8 +349,6 @@ class InvenTreeAPI { // Load selected profile profile = await UserProfileDBManager().getSelectedProfile(); - print("API Profile: ${profile.toString()}"); - if (profile == null) { showSnackIcon( L10().profileSelect, @@ -364,8 +362,6 @@ class InvenTreeAPI { _connected = await _connect(); - print("_connect() returned result: ${_connected}"); - _connecting = false; if (_connected) { @@ -747,8 +743,6 @@ class InvenTreeAPI { ); return false; } - - return allowBadCert; }); // Set the connection timeout @@ -857,6 +851,15 @@ class InvenTreeAPI { print("JSON format exception!"); print("${body}"); + sentryReportMessage( + "Error decoding JSON response from server", + context: { + "headers": response.headers.toString(), + "statusCode": response.statusCode.toString(), + "data": body.toString(), + } + ); + showServerError( L10().formatException, L10().formatExceptionJson + ":\n${body}"