Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

File for exception handling example

If we have a list of files and we would like to make sure we process as many as possible without any problem caused in the middle, we can catch the exception.

We have the following list of files. Notice that "two.txt" is missing and "zero.txt" has a 0 in it.

0
1

File two.txt is missing on purpose.

3