Skip to content

Repeated cause getting in ModuleSerializationProxy #12553

Closed
scala/scala
#9970
@djspiewak

Description

@djspiewak

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions