Log message configuration

Hi guys, please help me identify the right answer and explain to me the difference between
“exception.source” and “exception.message”.
Thanks in advance.

1.A developer wants to ensure that a process they are developing includes coherent logs with meaningful log messages. During the execution of the process, an application exception is caught and stored in a local variable called exception.
Based on UiPath best practices, how should the Log Message activity in the Catch section of this exception be configured?
A. Level: Warn -
Message: exception.Message + “at” + exception.Source
B. Level: Error -
Message: “Exception occurred at” + exception.Source
C. Level: Fatal -
Message: exception.Message
D. Level: Info -
Message: “Application Exception at” + exception.Source

2.A developer wants to ensure that a process they are developing includes log messages that are meaningful and indicate which activity caused the error. During the execution of the process, an Application Exception is caught and stored in a local variable called exception.
How should the Message property of the Log Message activity in the Catch section of this exception be configured?
A. exception.Message + “at” + exception.Source
B. exception.Message
C. “Application Exception at” + exception.Source
D. “Exception occurred at” + exception.Source

Hi @Latifa

For question 1, since it’s a system exception, you need to log the erroe data. So the correct answer will be:

B. Level: Error -
Message: “Exception occurred at” + exception.Source

For question 2, it’s better to get what is the error message & from where exactly we are getting the error message. So the correct answer will be:

A. exception.Message + “at” + exception.Source

Hope this helps,
Best Regards.

1 Like

@Anil_G and @raja.arslankhan what’s your input on this?

@Latifa

B
A

Exception.message - this will give the exact exception which has occured…this is basically the message

Exception.source - this is the value where the exception occured…like which activity it is…it would display the activity name

Note: exception.source will display activity name only if the try catch is used on a invoke workflow activity…if the try catch is used on a sequence or any other actvity then it would not give the activity name but it would give the activity type …something like UiPath.core.activity like this…but not the actual name of activity

Hope this helps

Cheers

1 Like

Thanks a lot

I am very grateful for your input

1 Like

@Latifa sorry just saw your query🙂. Next time I will look🙂

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.