Closed
Description
Specifically, note the following:
override protected def computeValue(cls: Class[_]): Object =
try getModule(cls)
catch {
case e: PrivilegedActionException =>
rethrowRuntime(e.getCause)
}
And then in rethrowRuntime
:
private def rethrowRuntime(e: Throwable): Object = {
val cause = e.getCause
cause match {
case exception: RuntimeException => throw exception
case _ => throw new RuntimeException(cause)
}
}
You'll note that we're doing getCause
twice here. I'm not sure that this is actually correct, since it would seem to mask the inner exception. Poking @retronym for clarification. I can definitely confirm that, when this code path is hit, the exception it generates is very unhelpful and does not contain the initial cause.