2
0
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:
Oliver 2022-01-05 12:18:23 +11:00
parent b9ee0157d2
commit fd54b20b92

View File

@ -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) {
if (error is CastError) {
// Ignore CastError
} else if (error is TypeError) {
// Ignore TypeError
} else {
// Unknown error - report it!
sentryReportError(error, stackTrace); sentryReportError(error, stackTrace);
}
// Unable to determine permission - assume true?
return true; return true;
} }
} }