i got 2 questions regarding best practice (i’m preparding for UiPath adv. certificate). i encountered two questions.
if i use the REF and i don’t use queues (and instead i read an excel first). where do i read the data initially? in the init state (in the “first run” sequence) or in the get transaction data state? i can make both work but what’s best practice?
if i use try catch and an exception will be thrown, what log level do i use in the catch block for “exception.source” and “exception.message”?
Both are good enough…depends on preference…Init first run would be best option…as no extra condition is needed for reading the files again in get transactiondata…but few think…as the name suggests get transaction data it is good to dot here…
Both are useful…even exception.stacktrace can be helpful…message gives the messgae and source gives which activity failed and the complete trace till that xaml as well…both has its own use and loglevel will be error if you are rethrowing it or throwing new exception…if you want to handle and continue then warning
if i use the REF and i don’t use queues (and instead i read an excel first). where do i read the data initially? in the init state (in the “first run” sequence) or in the get transaction data state? i can make both work but what’s best practice?
Answer : In the init state (in the “first run” sequence) you can do that
like reading the excel ,opening the browsers all like this
if i use try catch and an exception will be thrown, what log level do i use in the catch block for “exception.source” and “exception.message”?
Error or Fatal:
Use the “Error” log level when an exception represents a critical issue that prevents the workflow from continuing.
If the exception source and message indicate a severe problem that you cannot recover from, use the “Error” log level.
Warn or Info:
Use the “Warning” or “Info” log level for exceptions that are important but don’t necessarily halt the workflow.
If the exception source and message provide useful information for debugging or monitoring the workflow, use the “Warning” or “Info” level.
These log levels are typically used for situations that don’t lead to workflow termination but should still be noted.
1.in init state first run
2.error and exception.message
As for exception handling, when using a Try-Catch block, the log level for logging exception information such as exception.Source and exception.Message would typically be set to “Error.” This ensures that important error details are logged for troubleshooting and monitoring purposes. Logging at the “Error” level indicates that something unexpected has occurred and requires attention.