Exceptions concepts

Cards (6)

  • exceptions are used to model errors
  • should only catch an exception if in a place to deal with it
  • exceptions trickle down the execution nest stack until they are caught OR reach the end and crash the program
  • squelching exceptions - having an empty catch in a try catch to silence an exception. tempting to do this for checked exceptions to silence the compiler
  • good ones to know are illegalStateException and IllegalArgumentException
  • can create custom exceptions as subclasses of the next best fitting one