1 | |
package com.lexicalscope.fluentreflection; |
2 | |
|
3 | |
import java.lang.reflect.InvocationTargetException; |
4 | |
import java.lang.reflect.Member; |
5 | |
|
6 | |
public class InvocationTargetRuntimeException extends ReflectionRuntimeException { |
7 | |
private static final long serialVersionUID = -4623735792822350866L; |
8 | |
private Throwable exceptionThrownByInvocationTarget; |
9 | |
|
10 | |
private InvocationTargetRuntimeException(final String message, final Throwable cause) { |
11 | 0 | super(message, cause); |
12 | 0 | } |
13 | |
|
14 | |
public InvocationTargetRuntimeException(final InvocationTargetException cause, final Member member) { |
15 | 0 | this("Exception while invoking " + member, cause); |
16 | 0 | exceptionThrownByInvocationTarget = cause.getCause(); |
17 | 0 | } |
18 | |
|
19 | |
public Throwable getExceptionThrownByInvocationTarget() { |
20 | 0 | return exceptionThrownByInvocationTarget; |
21 | |
} |
22 | |
} |