From 811f99f1ebe664d4d2ba6fa2153251d7acc81e31 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Sun, 13 Aug 2023 08:32:10 +0100 Subject: [PATCH] handle case when no LDAP info can be found --- .../shoola/agents/metadata/LDAPLoader.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/openmicroscopy/shoola/agents/metadata/LDAPLoader.java b/src/main/java/org/openmicroscopy/shoola/agents/metadata/LDAPLoader.java index ddfae657d..d9143e8cb 100644 --- a/src/main/java/org/openmicroscopy/shoola/agents/metadata/LDAPLoader.java +++ b/src/main/java/org/openmicroscopy/shoola/agents/metadata/LDAPLoader.java @@ -22,7 +22,7 @@ -//Java imports +import omero.log.LogMessage; import org.openmicroscopy.shoola.agents.metadata.editor.Editor; import omero.gateway.SecurityContext; import org.openmicroscopy.shoola.env.data.views.CallHandle; @@ -66,6 +66,21 @@ public void load() handle = adminView.lookupLdapAuthExperimenter(ctx, userID, this); } + /** + * Overrides so we can display no LDAP info found. + * Do not show error in that case. + */ + public void handleException(Throwable exc) + { + viewer.setStatus(false); + String s = "Data Retrieval Failure: "; + LogMessage msg = new LogMessage(); + msg.print(s); + msg.print(exc); + registry.getLogger().error(this, msg); + viewer.setLDAPDetails(userID, "No LDAP information found"); + } + /** * Cancels the data loading. * @see EditorLoader#cancel()