サブルーチンでエラーが発生してスローした後のCatchハンドラでの「メッセージをログ」の書き方

UiPath Community Editionユーザです。
サブルーチンでアプリケーションエラーが発生してスローした後のCatchハンドラでの「メッセージをログ」の書き方が分かっていないので教えてください。
サブルーチンでエラーが発生してスローする際に、スローアクティビティで、

New exception(strサブルーチン名+exception.Message) ーー> A

と書いて、Try CatchのCatchハンドラに貼り付けた「メッセージをログ」アクティビティで

System.DateTime.Now.ToString+" "+exception.Message ーー> B

と書けば、Aの strサブルーチン名+exception.Message
Bの exception.Message に置換されてログに出力されると考えていますが、間違っていないでしょうか?

Hi @gorby

Can you explain a bit more ?

Regards
Sudharsan

Assuming that you write

New exception(var_1+exception.Message)

in throw activity written in try section in trycatch. ※var_1 is variable

Then you write

System.DateTime.Now.ToString+" "+exception.Message

in message log activity written in catch section in trycatch.

In this case, will the latter exception.Message be replaced by former var_1+exception.Message ?

Regards,
gorby

This will be in catch block ?

No, try block.

In try block why are you using exception.message?

Because I did not know exception.message is supposed to be NOT used in try block.

Will you please show me how to transfer error caused place and error reason from try block to catch block?

Can I use assign activity like

str_message = “error occurred”+vbcrlf+exception.Message

in try block?

Okay so this is how try catch works @gorby

You are trying some activity inside try block if that Particular activity throws error it will search for the most matchable exception and inside catch you can use exception.message

Checkout this video you will get a idea

Regards
Sudharsan