Lecture overview -- Keyboard shortcut: 'u'  Previous page: The hierarchy of exceptions in C# -- Keyboard shortcut: 'p'  Next page: Handling more than one type of exception in C# -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 20 : 30
Object-oriented Programming in C#
Exception Handling
The class System.Exception in C#

Some observations about the base class of all exceptions

  • Constructors

    • Parameterless: Exception()

    • With an explanation: Exception(string)

    • With an explanation and an inner exception: Exception(string,Exception)

  • Properties

    • Message: A description of the problem (string)

    • StackTrace: The call chain from the point of throwing to the point of catching

    • InnerException: The exception that caused the current exception

    • Data: A dictionary of key/value pairs.

      • For communication in between functions along the exception propagation chain.

    • Others...