gorby
(gorby)
October 29, 2022, 1:46pm
1
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
gorby
(gorby)
October 29, 2022, 2:16pm
3
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 ?
In try block why are you using exception.message?
gorby
(gorby)
October 29, 2022, 2:45pm
7
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