exceptions: Java exception handling companion code (suppression, chaining, cost)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KqJyCidz3ZgRyHABv2GVJh
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
=== which are checked? ===
|
||||
Exception CHECKED Exception -> Throwable -> Object
|
||||
IOException CHECKED IOException -> Exception -> Throwable -> Object
|
||||
InterruptedException CHECKED InterruptedException -> Exception -> Throwable -> Object
|
||||
RuntimeException unchecked RuntimeException -> Exception -> Throwable -> Object
|
||||
IllegalArgumentException unchecked IllegalArgumentException -> RuntimeException -> Exception -> Throwable -> Object
|
||||
NullPointerException unchecked NullPointerException -> RuntimeException -> Exception -> Throwable -> Object
|
||||
Error unchecked Error -> Throwable -> Object
|
||||
OutOfMemoryError unchecked OutOfMemoryError -> VirtualMachineError -> Error -> Throwable -> Object
|
||||
StackOverflowError unchecked StackOverflowError -> VirtualMachineError -> Error -> Throwable -> Object
|
||||
|
||||
=== checked exception inside a stream lambda: wrap in UncheckedIOException ===
|
||||
contents of a.txt
|
||||
caught: java.io.UncheckedIOException: java.io.IOException: cannot read bad.txt
|
||||
original cause: java.io.IOException: cannot read bad.txt
|
||||
Reference in New Issue
Block a user