How to use rethrow and log the exception message in main?

activities

#1

Hi,

Can anyone suggest how to log exception message in try block using rethrow?
Please upload the Sample code if possible.

Thanks