Skip to content

Commit

Permalink
Propagate target exception
Browse files Browse the repository at this point in the history
Closes gh-660
  • Loading branch information
jzheaux committed Oct 11, 2024
1 parent dfb7b4c commit 7bb0a7c
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2005-2013 the original author or authors.
* Copyright 2005-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,7 @@

import java.io.IOException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Hashtable;
Expand Down Expand Up @@ -203,7 +204,12 @@ else if (method.getName().equals(GET_TARGET_CONTEXT_METHOD_NAME)) {
return this.target;
}
else {
return method.invoke(this.target, args);
try {
return method.invoke(this.target, args);
}
catch (InvocationTargetException ex) {
throw ex.getTargetException();
}
}
}

Expand Down

0 comments on commit 7bb0a7c

Please sign in to comment.