Design Guidelines for Exceptions
This page is specific to:.NET Framework Version:2.03.03.54.0
.NET Framework Developer's Guide
Design Guidelines for Exceptions

Exceptions are the standard mechanism for reporting errors. Applications and libraries should not use return codes to communicate errors. The use of exceptions adds to a consistent framework design and allows error reporting from members, such as constructors, that cannot have a return type. Exceptions also allow programs to handle the error or terminate as appropriate. The default behavior is to terminate an application if it does not handle a thrown exception. For a detailed discussion of exceptions in the .NET Framework, see Handling and Throwing Exceptions.

Portions Copyright 2005 Microsoft Corporation. All rights reserved.

Portions Copyright Addison-Wesley Corporation. All rights reserved.

For more information on design guidelines, see the "Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries" book by Krzysztof Cwalina and Brad Abrams, published by Addison-Wesley, 2005.

In This Section

Exception Throwing

Describes guidelines for throwing exceptions.

Exception Handling

Describes guidelines for catching exceptions.

Catching and Throwing Standard Exception Types

Describes guidelines for working with common exceptions provided by the .NET Framework.

Designing Custom Exceptions

Describes guidelines for defining new exception types.

Exceptions and Performance

Describes guidelines for using design patterns to avoid performance issues related to exceptions.

See Also

Other Resources

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View