Propagate target exception

Closes gh-660
This commit is contained in:
Josh Cummings
2024-10-11 16:29:12 -06:00
parent dfb7b4ceeb
commit 7bb0a7c20e

View File

@@ -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.
@@ -18,6 +18,7 @@ package org.springframework.ldap.core.support;
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;
@@ -203,7 +204,12 @@ public abstract class AbstractTlsDirContextAuthenticationStrategy implements Dir
return this.target;
}
else {
return method.invoke(this.target, args);
try {
return method.invoke(this.target, args);
}
catch (InvocationTargetException ex) {
throw ex.getTargetException();
}
}
}