So our application has a nice, central exception handler, wherein the details of exceptions are logged, generic windows are displayed to the users, and shutdown happens in a nice graceful way. However, we now have a 3rd party component that, from time to time, (and potentially for perfectly valid reasons) calls Environment.FailFast. This blows our app out of the water, and looks quite terrible to our users. Is there some way to handle Environment.FailFast in an elegant way?
So our application has a nice, central exception handler, wherein the details of exceptions
Share
I can’t see a way, according to the various entries in MSDN this is a hard termination of the process. Any code you would create to handle this would reside in the process. It also doesn’t run finally blocks or any pending finalizers, so I’m guessing wouldn’t provide any events or hooks in order to allow custom code to run. In a way this makes sense, otherwise it might not fail “fast” and it argues to only use in cases of extreme process corruption.
http://msdn.microsoft.com/en-us/library/dd289241
I see
twothree options:Quote from MSDN: