Skip to content

util.control.Exception.catching doesn't catch certain exceptions even if you explicitly ask it to #4974

@scabug

Description

@scabug
scala> util.control.Exception.catching(classOf[InterruptedException]).withApply{x => ()} { throw new InterruptedException }
java.lang.InterruptedException
	at $anonfun$2.apply(<console>:8)
	at $anonfun$2.apply(<console>:8)
	at scala.util.control.Exception$Catch.apply(Exception.scala:88)
	at .<init>(<console>:8)
        [...]

Hey catching, I said CATCH! InterruptedException, I said!

This is kinda sorta documented, so arguably it was just my failure to RTFM. But it does seem odd to me that if I explicitly say I want to catch that exception, it doesn't override the shouldRethrow stuff.

Priority: low, no doubt. Opening the ticket anyway.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions