Skip to main content
Version: V2 (Ignition 8.1)

tamaki.mes.permissions.extractPermissionExceptionMessage

Description

Returns the raw permission-exception message: the substring of the exception text matched by the package's permission regex.

  • If the exception is not a permission exception, returns an empty dictionary {}.
  • If it is a permission exception but its message does not match the expected format, returns an error string.
  • Otherwise returns the matched access-denied message.

Syntax

tamaki.mes.permissions.extractPermissionExceptionMessage(exception)

Parameters

ParameterTypeNullableDescription
exceptionExceptionFalseThe caught permission exception.

Returns

A String containing the matched access-denied message. Returns an empty dictionary {} if the exception is not a permission exception, or an error string if the message cannot be parsed.

Code Examples

try:
system.mes.location.saveLocation(**location)
except Exception as e:
message = tamaki.mes.permissions.extractPermissionExceptionMessage(e)
print(message)