throw new MBeanException(
(Exception) targetException,
"Exception occured while invoking " + toSimpleName(method));
}
else if (targetException instanceof Error) {
throw new RuntimeErrorException(
(Error) targetException,
"Error occured while invoking " + toSimpleName(method));
}
else {
throw new RuntimeErrorException(
new AssertionError(targetException),
"Unexpected throwable occured while invoking " + toSimpleName(method));
}
}
catch (RuntimeException e) {
throw new RuntimeOperationsException(e, "RuntimeException occured while invoking " + toSimpleName(method));
}
catch (IllegalAccessException e) {
throw new ReflectionException(e, "IllegalAccessException occured while invoking " + toSimpleName(method));
}
catch (Error err) {
throw new RuntimeErrorException(err, "Error occured while invoking " + toSimpleName(method));
}
catch (Exception e) {
throw new ReflectionException(e, "Exception occured while invoking " + toSimpleName(method));
}
}