mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-15 12:36:24 +00:00
[refactor] Scan improvements (#577)
* Handle error on unexpected barcode response * Add ManufacturerPart detail view * Support barcode scanning for manufacturer part * Refactoring for null checks * Ignore selected errors in sentry * Fix API implementation for ManufacturerPart * Update release notes * More error handling * Decode quantity betterer * Refactoring * Add option to confirm checkin details * Improve response handlign * Cleanup * Remove unused imports * Fix async function * Fix for assigning custom barcode * Handle barcode scan result for company * Fix * Adjust scan priority * Refactoring MODEL_TYPE - Use instead of duplicated const strings * @override fix
This commit is contained in:
parent
6b179d108c
commit
524c5469f1
24 changed files with 576 additions and 220 deletions
|
|
@ -158,6 +158,11 @@ Future<bool> sentryReportMessage(String message, {Map<String, String>? context})
|
|||
*/
|
||||
Future<void> sentryReportError(String source, dynamic error, StackTrace? stackTrace, {Map<String, String> context = const {}}) async {
|
||||
|
||||
if (sentryIgnoreError(error)) {
|
||||
// No action on this error
|
||||
return;
|
||||
}
|
||||
|
||||
print("----- Sentry Intercepted error: $error -----");
|
||||
print(stackTrace);
|
||||
|
||||
|
|
@ -228,3 +233,18 @@ Future<void> sentryReportError(String source, dynamic error, StackTrace? stackTr
|
|||
print("Uploaded information to Sentry.io : ${response.toString()}");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Test if a certain error should be ignored by Sentry
|
||||
*/
|
||||
bool sentryIgnoreError(dynamic error) {
|
||||
// Ignore 404 errors for media files
|
||||
if (error is HttpException) {
|
||||
if (error.uri.toString().contains("/media/") && error.message.contains("404")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue