Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handle exceptions from WS

I've WS client written in C#. Is there any way I can handle all exceptions in one place? Now WS methods are executed in many places so I have to write many try...catch to handle them all.

Thanks

like image 433
arek Avatar asked Jan 23 '26 17:01

arek


1 Answers

use

  AppDomain.CurrentDomain.UnhandledException

before creating winform, you need to add this line

 Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
like image 153
Avram Avatar answered Jan 26 '26 07:01

Avram



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!