Exceptions
idea
- try some code, an error may be thrown, catch and handle
- try {some code} catch (Exception e) {handle error}
- allows (near) automatic error propagation, and
- code not littered with error-handling cases
control flow
- execute try code
- control goes from throw point directly to first matching catch on the caller stack
- if no error, then catch is skipped
- finally is always executed, if error happens or not, but always after error handling
- VM catches all unhandled exceptions, and aborts