mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-14 12:06:24 +00:00
Reduce error reporting for model requests
This commit is contained in:
parent
0d6d0f754a
commit
232535d166
1 changed files with 39 additions and 33 deletions
|
|
@ -199,6 +199,7 @@ class InvenTreeModel {
|
||||||
if (!response.isValid() || response.data == null || !(response.data is Map)) {
|
if (!response.isValid() || response.data == null || !(response.data is Map)) {
|
||||||
|
|
||||||
// Report error
|
// Report error
|
||||||
|
if (response.statusCode > 0) {
|
||||||
await sentryReportMessage(
|
await sentryReportMessage(
|
||||||
"InvenTreeModel.reload() returned invalid response",
|
"InvenTreeModel.reload() returned invalid response",
|
||||||
context: {
|
context: {
|
||||||
|
|
@ -210,6 +211,7 @@ class InvenTreeModel {
|
||||||
"errorDetail": response.errorDetail,
|
"errorDetail": response.errorDetail,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
showServerError(
|
showServerError(
|
||||||
L10().serverError,
|
L10().serverError,
|
||||||
|
|
@ -270,6 +272,7 @@ class InvenTreeModel {
|
||||||
|
|
||||||
if (!response.isValid() || response.data == null || !(response.data is Map)) {
|
if (!response.isValid() || response.data == null || !(response.data is Map)) {
|
||||||
|
|
||||||
|
if (response.statusCode > 0) {
|
||||||
await sentryReportMessage(
|
await sentryReportMessage(
|
||||||
"InvenTreeModel.get() returned invalid response",
|
"InvenTreeModel.get() returned invalid response",
|
||||||
context: {
|
context: {
|
||||||
|
|
@ -281,6 +284,7 @@ class InvenTreeModel {
|
||||||
"errorDetail": response.errorDetail,
|
"errorDetail": response.errorDetail,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
showServerError(
|
showServerError(
|
||||||
L10().serverError,
|
L10().serverError,
|
||||||
|
|
@ -311,6 +315,7 @@ class InvenTreeModel {
|
||||||
// Invalid response returned from server
|
// Invalid response returned from server
|
||||||
if (!response.isValid() || response.data == null || !(response.data is Map)) {
|
if (!response.isValid() || response.data == null || !(response.data is Map)) {
|
||||||
|
|
||||||
|
if (response.statusCode > 0) {
|
||||||
await sentryReportMessage(
|
await sentryReportMessage(
|
||||||
"InvenTreeModel.create() returned invalid response",
|
"InvenTreeModel.create() returned invalid response",
|
||||||
context: {
|
context: {
|
||||||
|
|
@ -322,6 +327,7 @@ class InvenTreeModel {
|
||||||
"errorDetail": response.errorDetail,
|
"errorDetail": response.errorDetail,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
showServerError(
|
showServerError(
|
||||||
L10().serverError,
|
L10().serverError,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue