First page Back Continue Last page Graphics
13.2 Exception-Handling Overview
Exception handling
- For synchronous errors (divide by zero, null pointer)
- Cannot handle asynchronous errors (independent of program)
- Disk I/O, mouse, keyboard, network messages
- Easy to handle errors
Terminology
- Function that has error throws an exception
- Exception handler (if it exists) can deal with problem
- Catches and handles exception
- If no exception handler, uncaught exception