What is the best way to map exceptions with exception number?

Hi,
I got a scenario, where need to segregate exceptions based on numbers. For e.g., if there are 3 business exceptions defined, want to map each exception with a number.

This helps to figure out how many times a specific business exception occurred in a month.

what is the best possible way to do this?

Hi @Purabi_Sarma

Create an asset in the Orchestrator and name it as Business Exception Count and initialize value as 0. Where you are Handling the Business exception in the workflow, in that use Get asset activity to get the asset value from Orchestrator, after that use assign activity to increment the value of BusinessException Count and use Set Asset activity to update the Count in to the asset to the Orchestrator.

By doing this, if you got any Business exception the Count Value in the asset will increments and update it to the asset in Orchestrator and you can check at the end of the month.

Hope it helps!!

Hi @mkankatala , thanks for your response.

But my requirement is not to get overall business exception counts.

I need to map each business exception with a number, for e.g

Business exception 1 = Error number 100
Business Exception 2 = 101

At the end of the month, this will help to report each Business Exception count.

Okay @Purabi_Sarma

In this case you have to update every business exception to excel.

Create an excel sheet Manually with two columns Exception Number and Exception Message.

In the code where you are handling Business exceptions, there follow the below steps,
→ Use Build datatable activity and add two columns as created in excel and create a variable called dt.
→ Use the Asset logic that I posted in the previous post to take the count.
→ After that use the Add Data row activity to add the row to the datatable variable dt.
→ Use the Append range workbook activity to append the datatable to the Manually created excel.

Hope you understand!!

Hi @mkankatala ,
I dont need to write to an excel, I already have a sql db with a Log table in it, where I’ll be inserting logs (success/exceptions).

I didn’t want to write the error numbers for each business exceptions from the UiPath code and was wandering if there is a better approach to map error numbers with exceptions.

Anyways thanks for your response.