Lecture overview -- Keyboard shortcut: 'u'  Previous page: Recommendations about exception handling -- Keyboard shortcut: 'p'    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 30 : 30
Object-oriented Programming in C#
Exception Handling
Recommendations about exception handling

  • Exception classes

    • Prefer predefined exception classes instead of programming your own exception classes

    • Consider specialization of existing and specific exception classes

  • Catching

    • Do not catch exceptions for which there is no cure

    • Leave such exceptions to earlier (outer) parts of the call-chain

  • Burying

    • Avoid empty handler exceptions - exception burrying

    • If you touch an exception without handling it, always rethrow it