// Invoked method threw an error. Wrapped as a JMX runtime error exception.
else if (target instanceof Error)
{
throw new InvocationException(
new RuntimeErrorException((Error)target, target.toString())
);
}
else throw new InvocationException(new Error("Unhandled exception: " + t.toString()));
}
// assume all other exceptions are reflection related
else if (t instanceof Exception)
{
throw new InvocationException(
new ReflectionException((Exception)t, t.toString())
);
}
else if (t instanceof Error)
{
throw new InvocationException(
new RuntimeErrorException((Error)t, t.toString())
);
}
throw new InvocationException(new Error("Unhandled exception: " + t.toString()));
}