English
Topic 4. Exception handling and program debugging
Goal: learn to define error contracts, handle exceptions, preserve causes, and find logic errors with a debugger.
Lecture contents
- Exceptions and the Throwable hierarchy — Errors as part of a contract · The Throwable hierarchy · try and catch order
- finally, throw, and throws — finally and control flow completion · throw, throws, and preconditions
- Custom exceptions and resources — A custom type and the original cause · Automatic resource closing
- Checks and debugging — Assert and user data validation · Stack traces and causes · Debugging in IntelliJ IDEA · Error testing protocol