mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 13:36:50 +00:00
Reduce error reporting on permission check errors
This commit is contained in:
parent
b9ee0157d2
commit
fd54b20b92
11
lib/api.dart
11
lib/api.dart
@ -488,7 +488,16 @@ class InvenTreeAPI {
|
|||||||
List<String> perms = List.from(roles[role] as List<dynamic>);
|
List<String> perms = List.from(roles[role] as List<dynamic>);
|
||||||
return perms.contains(permission);
|
return perms.contains(permission);
|
||||||
} catch (error, stackTrace) {
|
} catch (error, stackTrace) {
|
||||||
sentryReportError(error, stackTrace);
|
if (error is CastError) {
|
||||||
|
// Ignore CastError
|
||||||
|
} else if (error is TypeError) {
|
||||||
|
// Ignore TypeError
|
||||||
|
} else {
|
||||||
|
// Unknown error - report it!
|
||||||
|
sentryReportError(error, stackTrace);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unable to determine permission - assume true?
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user