Wednesday 15 February 2012

Exception Hierarchy for selenium automation learning


Exception Hierarchy

                    +--------+
| Object |
+--------+
|
|
+-----------+
| Throwable |
+-----------+
/ \
/ \
+-------+ +-----------+
| Error | | Exception |
+-------+ +-----------+
/ | \ / | \
\________/ \______/ \
+------------------+
unchecked checked | RuntimeException |
+------------------+
/ | | \
\_________________/

unchecked
  • most of the built-in exceptions (e.g., NullPointerException, IndexOutOfBoundsException) are unchecked.
  • IOExceptions (e.g., FileNotFoundException) are checked
  • user-defined exceptions should usually be checked, so they should be subclasses of Exception.