Lecture overview -- Keyboard shortcut: 'u'  Previous page: Examples of normal and exceptional aspects -- Keyboard shortcut: 'p'  Next page: How are errors handled? -- 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 6 : 30
Object-oriented Programming in C#
Exception Handling
When are errors detected?

It is attractive to find errors as early as possible

  • During design and programming - Go for it.

  • During compilation - syntax errors or type errors - Attractive.

  • During testing - A lot of hard work. But necessary.

  • During execution and final use of the program

    • Handled errors - OK. But difficult.

    • Unhandled errors - A lot of frustration.

Exception handling is primarily concerned with detection and handling of "the real exceptions" in the executing program

Exception handling adds robustness to the final program