Hello,
I’m a user of UiPath Studio 2025.0.161STS Community edition.
I’d like to confirm two points about how the TryCatch activity works.
Is it correct that when an exception raised in the Try block is caught by the Catch block, no information is passed from the Try block to the Catch block via variables or arguments?
Is it correct that if an exception occurs in the Try block, the exception is thrown even if there is no Throw activity in the Try block?
This response was given by the Forum ChatBot, So I’m pretty sure it’ll be accurate for this question:
Regarding information transfer to the Catch block:
In UiPath, when an exception occurs within the Try block, the runtime creates an exception object. This exception object is not “transferred” via variables or regular arguments; rather, it is caught automatically by the Catch block and made available through the designated exception parameter. Any variables from the Try block do not inherently pass their state to the Catch block unless they are declared in a broader scope. Summary: Yes, it is correct that the exception details are not passed through variables or arguments from the Try block to the Catch block. They are automatically encapsulated in the exception object made available in Catch.
2.Regarding the need for an explicit Throw activity:
When an exception occurs in the Try block due to an error (for example, a runtime error) the exception is automatically thrown by the system—it does not require a Throw activity inside the Try block. The Throw activity is used when you need to explicitly raise an exception (for custom error handling or rethrowing after catching an exception), but if an error naturally occurs, UiPath will trigger the exception and transfer control to the Catch block even if there isn’t an explicit Throw activity. Summary: Yes, it is correct that an exception is thrown automatically when it occurs in the Try block, even without a Throw activity.
The intent is a little unclear, but variables depend on scope. Variables defined in the scope that contains the Try Catch can be used in both (information is not passed between them).
Variables defined in a Sequence inside the Try block cannot be used in the Catch block.
Arguments can be used throughout the entire file, so they can also be used in the Catch block.
Is it correct to understand that if an exception occurs in the Try block, it will be thrown even if there is no Throw activity in the Try block?
If an exception occurs in an activity, the exception is thrown, so this does not necessarily depend on a Throw activity.
Since you said the intent was unclear, let me rephrase.
It seems that exception information can be passed between TryBlock and CatchBlock without defining variables (arguments) related to the exception, so it looks as though TryBlock and CatchBlock pass exception information by some means other than variables (arguments). Is this understanding correct?
The exception (information) that occurs in Try is passed internally to the Catch side and stored in the specified variable, so I think that understanding is correct.