mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 02:05:29 +00:00
Improve barcode error handling
This commit is contained in:
@ -77,7 +77,7 @@ class BarcodeHandler {
|
||||
body: {
|
||||
"barcode": barcode,
|
||||
},
|
||||
expectedStatusCode: 200
|
||||
expectedStatusCode: null, // Do not show an error on "unexpected code"
|
||||
);
|
||||
|
||||
_controller?.resumeCamera();
|
||||
@ -90,7 +90,7 @@ class BarcodeHandler {
|
||||
|
||||
// We want to know about this one!
|
||||
await sentryReportMessage(
|
||||
"BarcodeHandler.processBarcode returned strange value",
|
||||
"BarcodeHandler.processBarcode returned unexpected value",
|
||||
context: {
|
||||
"data": response.data?.toString() ?? "null",
|
||||
"barcode": barcode,
|
||||
@ -102,7 +102,7 @@ class BarcodeHandler {
|
||||
"overlayText": getOverlayText(context),
|
||||
}
|
||||
);
|
||||
} else if (data.containsKey("error")) {
|
||||
} else if ((response.statusCode >= 400) || data.containsKey("error")) {
|
||||
onBarcodeUnknown(context, data);
|
||||
} else if (data.containsKey("success")) {
|
||||
onBarcodeMatched(context, data);
|
||||
|
Reference in New Issue
Block a user