Exception handling
An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program's instructions.
Types of exceptions
- Checked exception
- Error
- Runtime exception
- Checked exceptions are checked at compile time. If a code throws a checked exception, then the associated block or method must handle the exception. For example,
FileNotFoundException
is a checked exception. If a method creates theFileInputStream
object to read data from, a file must handleFileNotFoundException
. If the specified file does not exist, thenFileNotFoundException
occurs and this exception must be caught or thrown. - Errors are exceptional conditions that are external to the application and it's not possible to anticipate and ...
Get Learning Selenium Testing Tools - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.