IOException
The checked exception Java uses for failed input or output, such as an unreadable file or a dropped network connection.
In more detail
Because it is checked, any method that may throw it must declare it, so its callers must deal with it. The course catches one at the storage layer and translates it into a domain exception, keeping the original as the cause.
Example
catch (java.io.IOException ex) { throw new StorageFailure(ex); }Related terms
- checked exception — An exception type that the compiler forces every caller to either catch or declare with throws, making the failure part of the method's contract.
- exception translation — Catching a low-level exception at a boundary and throwing a higher-level one that fits the caller's vocabulary, keeping the original as the cause.
Taught in
- Checked Versus Unchecked Exceptions — Modern Java: Virtual Threads & High-Throughput Services
- The Cost Of Checked Exceptions — Modern Java: Virtual Threads & High-Throughput Services
- Inheritance, Overriding And Object's Methods — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Checked, Unchecked, Catch And Finally — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Try-With-Resources And Suppressed Exceptions — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Sprint: Exceptions, Arrays And Collections — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Console And File I/O With Streams — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Paths And Files With NIO.2 — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Final Review And Exam Day — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep