mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Report message to sentry in case of bad JSON decoding
This commit is contained in:
parent
aea0036881
commit
2a5bb4631b
1 changed files with 9 additions and 6 deletions
15
lib/api.dart
15
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}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue