Lecture overview -- Keyboard shortcut: 'u'  Previous page: Try-catch with a finally clause -- Keyboard shortcut: 'p'  Next page: Raising an exception in an exception handler -- 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 25 : 30
Object-oriented Programming in C#
Exception Handling
Rethrowing an exception

Inside a handler, you can either rethrow an exception or raise/throw a new exception

  • Rethrowing

    • Preserving information about the original exception, and the call chain

    • Usually recommended

/user/normark/oop-csharp-1/sources/c-sharp/exception/rethrowing/1/prog.csRethrowing an exception. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/exception/rethrowing/1/outputOutput from the program that rethrows an exception.


Touching, but not handling the exception

An outer handler will see the original exception