If you test the above exception handler, you will find that the name of the rule set is not identified in the e-mail message. In the following example, you will find it easy to tell which rule failed because you only have one rule set and a couple of rules. In a production environment you may have many rule sets, each containing many rules, making it difficult to tell in which rule set the error occurred. To help identify the rule set, a rule set variable that contains the name of the rule set, can be created. The value of variable can then be included in the exception e-mail message.
- In Rule Builder, from the Edit menu, select Manage Variables.
- In the Manage Variables Editor window that appears, click the Rule Set Variables tab.
- Click the Add Variable button.
- In the Name column, type the rule set name.
- In the Data Type list, select String, and in the Current Value column select the default value of the rule sets current name.
- To save the variable and close the editor, click OK.
- For each exception that is being handled specifically with an e-mail, edit the body of the e-mail to include the value of the rule set name variable. The syntax to reference the rule set variable is
%#Rule Set Name%
. So the new subject would be:An exception was thrown by the action %triggerEvent.RuleName% in rule set %#Rule Set Name% while processing %triggerEvent.Action.Pages.Name%
Error: %triggerEvent.Message%
Note: If the rule set is copied or renamed, the default value of the rule set name variable must be manually updated to the new name of the rule set.