Skip to content

Commit 4733b6c

Browse files
committed
Propagate target exception
Closes gh-660
1 parent 0b90840 commit 4733b6c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/src/main/java/org/springframework/ldap/core/support/AbstractTlsDirContextAuthenticationStrategy.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2005-2013 the original author or authors.
2+
* Copyright 2005-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
1818

1919
import java.io.IOException;
2020
import java.lang.reflect.InvocationHandler;
21+
import java.lang.reflect.InvocationTargetException;
2122
import java.lang.reflect.Method;
2223
import java.lang.reflect.Proxy;
2324
import java.util.Hashtable;
@@ -203,7 +204,12 @@ else if (method.getName().equals(GET_TARGET_CONTEXT_METHOD_NAME)) {
203204
return this.target;
204205
}
205206
else {
206-
return method.invoke(this.target, args);
207+
try {
208+
return method.invoke(this.target, args);
209+
}
210+
catch (InvocationTargetException ex) {
211+
throw ex.getTargetException();
212+
}
207213
}
208214
}
209215

0 commit comments

Comments
 (0)