Scala and the JVM · Part 20
unapply decides what catch catches: Scala extractors in match and try/catch
A hand-written unapply turns a catch block into a policy: pass your own errors through, wrap recoverable JVM exceptions, and let fatal ones propagate. A runnable Scala 2.13 demo shows exactly when the matcher calls it.