Can you give me a scenario- why do we need to use rethrow?

because you might have common error handling logic e.g. send email

Simple example:
main calls process1 & process2

if we rethrow errors from process1&2 to main, then we only need to handle the errors in main.xaml

if we dont rethrow, we need logic to send email in process1 & process2. Meaning code will be repeated

2 Likes