Catch Exceptions
Last updated
Last updated
In the Catch block we encounter two different scenarios:
a controlled exception has been caught or
an uncontrolled exception has been caught.
We want to treat both situations equally in the catch block.
Set DDP_TryCatchMessage
= Document Property - Base - Try/Catch Message
Use the created Dynamic Document Properties to handle the Exception.
In case of an uncontrolled exception, the script passes through the Try/Catch Message in DDP_rootCause
=DDP_TryCatchMessage
. The property name is fix, and that is why you user-defined exception messages should contain a "rootCause" element, so that you can access the error message through that property, no matter if the exception was controlled or uncontrolled.
DDP_userMessage
is set to "Something went wrong! Please contact your admin!".
Source Code on GitHub