Lecture 21
12
Error handling in Juno 7
•JunoExceptions are caught in the try/catch in CLIShell interpret lines 73-89
•Note how different kinds of Exceptions are dealt with in order
•ExitShellException is thrown (only) by doIt in LogoutCommand class
•BadShellCommandException knows what command was bad so we can give help
•Catch a generic JunoException and print its message
•Then deal with truly unexpected errors … catch any Exception. At least Juno won’t crash.