Code example for InvocationTargetException

Methods: getCause

0
	public Object execute(Object object) throws Exception {
		try { 
			return _method.invoke(object, _arguments);
		} 
		catch (InvocationTargetException ite) {
			Throwable t = ite.getCause();
 
			if (t instanceof Exception) {
				throw (Exception)t;
			} 
			else { 
				throw new Exception(t);
			} 
		} 
	} 
 
	public Object[] getArguments() { 
		return _arguments; 
	} 
 
Experience pair programming with AI  Get Codota for Java