In PrivilegeDb use function instead of macro for common exception handling