2010 | OriginalPaper | Buchkapitel
Exceptions
Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.
Wählen Sie Textabschnitte aus um mit Künstlicher Intelligenz passenden Patente zu finden. powered by
Markieren Sie Textabschnitte, um KI-gestützt weitere passende Inhalte zu finden. powered by
In this chapter, we have explored the mechanism that C# uses to express and process error conditions. We have thrown, caught, and handled the built-in exceptions that the .NET Framework includes for common problems and derived custom types that can be used for application-specific issues.
We have also covered the need to throw meaningful exceptions that are useful to other programmers and the importance of including as much relevant information as possible when throwing an exception. We have seen the convention of differentiating between different problems by throwing instances of different classes derived from System.Exception. Finally, we looked at aggregating exceptions when it is essential to indicate multiple, simultaneous issues—something that we will revisit when we come to look at parallel programming techniques later in this book.