The CLR won??™t abort your application,
but your application will likely be in an undefined state if an exception is thrown during execution
of a Finally block.
Summary
This chapter covered the basics of exception handling along with how you should apply the
Expert pattern to determine the best place to handle a particular exception. The meat of this
chapter described techniques for creating bulletproof exception-safe code that guarantees
system stability in the face of unexpected exceptional events. We also described constrained
execution regions that you can use to postpone asynchronous exceptions during thread termination.
Creating bulletproof exception-safe and exception-neutral code is no easy task.
For many development efforts, exception safety is an afterthought. In reality, exception
safety is a crucial issue that you should consider at software design time. Failure to do so will
result in substandard systems that will do nothing but frustrate users and lose market share to
those companies whose developers spent a little extra time getting exception safety right.
Moreover, there??™s always the possibility, as computers integrate more and more into people??™s
daily lives, that government regulations could force systems to undergo rigorous testing in
order to prove they are worthy for society to rely upon.
Pages:
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281