I can't move the LogMessage activity into the Catch block of the TryCatch activity.

Hello.

I’m a UiPath StudioX Enterprise Licence 2024.10.14 LTS user.

After moving a LogMessage activity with the following text in the message field to the Catch block of a TryCatch activity:
"異常終了:" + exec_SystemException.message

I got the warning message “Value cannot be null.” shown below.

Could it be that StudioX cannot handle System.Exception variables, and that I have to use a string variable for the error message?

`



@gorby

Try removing the initialization with Nothing. Keep it blank.

Hi, @ashokkarale

After removing the initialization with Nothing no improvement was found.
Hope your trully useful advice.

Regards,
gorby

Hi @gorby,

You can use either of these approaches:

  • Add a Log Message activity in the Catch block and use this expression: "異常終了:" + exception.Message and delete the existing Log Message activity outside the Try-Catch block.

  • Use an Assign activity in the Catch block with the following assignment: exec_SystemException = exception

Thanks!

Hey, my passionate UiPath instructor who might like biryani,
Your second suggestion worked!

Please use the **Assign** activity inside the Catch block with the following assignment:

**`exec_SystemException = exception`**

May Durga bless you.