public static void invocationException(final String error, final InvocationTargetException e) { final Throwable targetException = e.getTargetException(); if (targetException instanceof ApplicationException) { // an application exception from the domain code is re-thrown as an NO exception with same // semantics throw new NakedObjectApplicationException(targetException); } if (targetException instanceof RuntimeException) { throw (RuntimeException) targetException; } else { throw new ReflectionException(targetException); } }
public static void invocationException(final String error, final InvocationTargetException e) { final Throwable targetException = e.getTargetException(); if (targetException instanceof ApplicationException) { // an application exception from the domain code is re-thrown as an NO exception with same // semantics throw new NakedObjectApplicationException(targetException); } if (targetException instanceof RuntimeException) { throw (RuntimeException) targetException; } else { throw new ReflectionException(targetException); } }