tamaki.mes.permissions.isPermissionException
Description
Returns True if the given exception is a permission (access-denied) exception: that is, if its
string representation contains MissingPermissionException. Returns False otherwise, including if
the check itself fails.
Syntax
tamaki.mes.permissions.isPermissionException(exception)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
exception | Exception | False | The caught exception (or any object whose string form is tested). |
Returns
A Boolean: True if the exception is a permission exception, otherwise False.
Code Examples
try:
system.mes.location.deleteLocation(locationId)
except Exception as e:
if tamaki.mes.permissions.isPermissionException(e):
# The user does not have permission to delete this location
pass