...
Code Block | ||
---|---|---|
| ||
try { // Requested file does not exist }catch(FileNotFoundException) { /* ask the user for a different filename */ } |
Wiki Markup |
---|
Although, not explicitly required by this recommendation, failure tolerant systems must also catch and handle unexpected unchecked exceptions resulting from programming errors. In all other cases, refrain from using the {{throws}} clause to force the client into dealing with unchecked exceptions \[[Bloch 08|AA. Java References#Bloch 08]\]. |
Exceptions
EX1: It is reasonable to ignore an exception that occurs within a catch
or finally
block, such as when closing a FileInputStream
object.
...