-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
scala/scala
#9970Milestone
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.