...
Code Block | ||
---|---|---|
| ||
try { // Requested file does not exist }catch(IOException) { /* ask the user for a different filename */ } |
Although, not explicitly required by this recommendation, failure tolerant systems must also catch and handle unexpected unchecked exceptions resulting from programming errors.
Exceptions
It is reasonable to ignore an exception which occurs within a catch
or finally
block, such as while trying to close a FileInputStream
object. It is also permissible when the client cannot be expected to recover from the exception easily.
...