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:
2026-09-30 18:45:53 +00:00
co-authored by Claude Sonnet 5.5
parent 4a74153d87
commit bfa7f97432
32 changed files with 688 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
=== wrapped WITH the cause ===
getMessage(): could not load order 42
getCause(): java.lang.IllegalStateException: connection reset by peer
java.lang.RuntimeException: could not load order 42
at com.ankurm.exceptions.ChainingDemo.serviceGood(ChainingDemo.java:10)
at com.ankurm.exceptions.ChainingDemo.print(ChainingDemo.java:20)
at com.ankurm.exceptions.ChainingDemo.main(ChainingDemo.java:30)
Caused by: java.lang.IllegalStateException: connection reset by peer
at com.ankurm.exceptions.ChainingDemo.dao(ChainingDemo.java:6)
at com.ankurm.exceptions.ChainingDemo.serviceGood(ChainingDemo.java:9)
... 2 more
=== wrapped WITHOUT the cause (message copied as a string) ===
getMessage(): could not load order 42: connection reset by peer
getCause(): null
java.lang.RuntimeException: could not load order 42: connection reset by peer
at com.ankurm.exceptions.ChainingDemo.serviceBad(ChainingDemo.java:15)
at com.ankurm.exceptions.ChainingDemo.print(ChainingDemo.java:20)
at com.ankurm.exceptions.ChainingDemo.main(ChainingDemo.java:31)