From 0123dce575a1d1def2e5d6a2604716b30b076c63 Mon Sep 17 00:00:00 2001 From: payonel Date: Sat, 14 Oct 2017 16:30:25 -0700 Subject: [PATCH] preserve original exception thrown for machine arch ctors to not "eat" the original exception, we can just set it in the IllegalArgumentException's cause, see https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#getCause() closes: #2146 --- src/main/scala/li/cil/oc/server/machine/Machine.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/li/cil/oc/server/machine/Machine.scala b/src/main/scala/li/cil/oc/server/machine/Machine.scala index febf43a44..51f1bdb88 100644 --- a/src/main/scala/li/cil/oc/server/machine/Machine.scala +++ b/src/main/scala/li/cil/oc/server/machine/Machine.scala @@ -1027,7 +1027,7 @@ object Machine extends MachineAPI { architecture.getConstructor(classOf[machine.Machine]) } catch { - case t: Throwable => throw new IllegalArgumentException("Architecture does not have required constructor.") + case t: Throwable => throw new IllegalArgumentException("Architecture does not have required constructor.", t) } checked += architecture }