M
Mahesh Devjibhai Dhola
Hi,
I have one program, where i am using IO and Socket Asynchronous methods
"BeginXXX" and "EndXXX".
Many time, it happens that in Async delegate method, some exception occurs
and if i dont handle it, it shows standard Unhandled exception box even I
have handled the exception using try/catch in the main thread which is
caller of that method.
That means, the exception cant be handled by catch block written in main
thread if the exception occurs in a thread other than main.
My intention is to get the exception message so i can handle it gracefully
and show a userfriendly message on that exception. So usual, i use re-throw
the exceptions and handle in main UI blocks, if its not possible to return
values or if return value is possible then as return value so in UI blocks i
can show user friendly messages.
But as mentioned above, in multi-threaded program, if such condition happens
then what is the solution?
Is it possible to do that anyhow?
Is it by design or my program has bad-design?
If this is bad design then please suggest better way,
Thanking you in Advance,
Regards,
Mahesh
I have one program, where i am using IO and Socket Asynchronous methods
"BeginXXX" and "EndXXX".
Many time, it happens that in Async delegate method, some exception occurs
and if i dont handle it, it shows standard Unhandled exception box even I
have handled the exception using try/catch in the main thread which is
caller of that method.
That means, the exception cant be handled by catch block written in main
thread if the exception occurs in a thread other than main.
My intention is to get the exception message so i can handle it gracefully
and show a userfriendly message on that exception. So usual, i use re-throw
the exceptions and handle in main UI blocks, if its not possible to return
values or if return value is possible then as return value so in UI blocks i
can show user friendly messages.
But as mentioned above, in multi-threaded program, if such condition happens
then what is the solution?
Is it possible to do that anyhow?
Is it by design or my program has bad-design?
If this is bad design then please suggest better way,
Thanking you in Advance,
Regards,
Mahesh