How to write system exception in Excel

I want to write all exception in Excel.

@Anil_Potekar

When the exception comes you want to write or you want to get the exception value from excel?

If the first then in your exception block use write cell and exception.message will give the exception details

If the second then if you are using RE Framework just give the exceptions in config and use throw activity with this New Exception(config("ExceptionName").ToString)

Hope this helps

cheers

1 Like

Hi @Anil_Potekar
You can get the source by using “exception.source”.

please find below screenshot:

Regards…!!
MOhini :slight_smile:
Happy automation…!!!

Hi @Anil_Potekar,

To get the Exception details in a catch block, you can use Exception.Message but make sure it is thrown with New SystemException(“some message”) so you could catch it and perform related tasks like writing details to excel.
Or if you are using REFramework, system exceptions throw logic is already there, only thing you need to do is write exception detail to excel sheet.

To write detail in excel sheet, use a read range at start of your flow to store count of present records (as we will append data to old records).
In your catch block, use write cell range activity.

Assign exception values to variable
And write that variable value in excel

Exception.message
Or exception.source