Skip to content

Commit

Permalink
Fix role loading issue in MI dashboard with correlation logs enabled
Browse files Browse the repository at this point in the history
Fix role loading issue in MI dashboard with correlation logs enabled. Fixes: #4024
  • Loading branch information
DedunuKarunarathne committed Feb 24, 2025
1 parent 844bd06 commit 4a295af
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.wso2.micro.integrator.security.util.Secret;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
Expand Down Expand Up @@ -723,7 +724,18 @@ public LdapContextInvocationHandler(Object previousContext) {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

long start = System.currentTimeMillis();
Object result = method.invoke(this.previousContext, args);
Object result;
try {
result = method.invoke(this.previousContext, args);
} catch (InvocationTargetException e) {
Throwable cause = e.getCause();

if (cause instanceof NamingException) {
throw (NamingException) cause; // Properly declared exception
}

throw new RuntimeException("Exception in LDAP proxy method: " + method.getName(), cause);
}
long delta = System.currentTimeMillis() - start;
String methodName = method.getName();
int argsLength = 0;
Expand Down

0 comments on commit 4a295af

Please sign in to comment.