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
This commit is contained in:
payonel 2017-10-14 16:30:25 -07:00
parent fd5fd98c84
commit 0123dce575

View File

@ -1027,7 +1027,7 @@ object Machine extends MachineAPI {
architecture.getConstructor(classOf[machine.Machine]) architecture.getConstructor(classOf[machine.Machine])
} }
catch { 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 checked += architecture
} }