From f6fd3e0367ce7327cb6410285ac8c2ade6cf5801 Mon Sep 17 00:00:00 2001 From: Mike Duff Date: Mon, 31 Mar 2014 14:59:47 -0500 Subject: [PATCH] Issue #2899 - Improve error messages. Change-Id: Iba298e66d1b889fce8cde9103674c86558bd222c Former-commit-id: d6ce901a3acfd392c6beebd19e3da8c0682e228d [formerly dc81b79eca00f2a6209a563bdbb8383cfbf06c13 [formerly bcdfd5a0c98713c74b11435d7d33b1712a09d54b] [formerly d6ce901a3acfd392c6beebd19e3da8c0682e228d [formerly e83da0adee12900da03cb4b273a90d13fc5fc327]]] Former-commit-id: dc81b79eca00f2a6209a563bdbb8383cfbf06c13 [formerly bcdfd5a0c98713c74b11435d7d33b1712a09d54b] Former-commit-id: dc81b79eca00f2a6209a563bdbb8383cfbf06c13 Former-commit-id: b1aae9256cb3cfa91727f1dfb4ae249ccff884bd --- .../session/SharedDisplaySession.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SharedDisplaySession.java b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SharedDisplaySession.java index 65012ee318..3a0b61ddf2 100644 --- a/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SharedDisplaySession.java +++ b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SharedDisplaySession.java @@ -91,6 +91,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant; * Mar 06, 2014 2751 bclement added calls to getParticipantUserid() * Mar 07, 2014 2848 bclement moved pubsub close logic to closePubSub() * ensure that subscription is setup before joining room + * Mar 31, 2014 2899 mpduff Improve error messages. * * * @@ -186,7 +187,7 @@ public class SharedDisplaySession extends VenueSession implements * #sendObjectToVenue(java.lang.Object) */ @Override - public void sendObjectToVenue(Object obj){ + public void sendObjectToVenue(Object obj) { if (obj == null) { return; } @@ -300,15 +301,20 @@ public class SharedDisplaySession extends VenueSession implements * configureVenue(java.lang.String) */ @Override - public void configureVenue() - throws CollaborationException { + public void configureVenue() throws CollaborationException { try { configureSubscription(); } catch (XMPPException e) { closePubSub(); - throw new CollaborationException( - "Unable to configure subscription", e); + int errorCode = e.getXMPPError().getCode(); + String errorMsg = "Error configuring subscription"; + + if (errorCode == 404) { + errorMsg = "Shared display session no longer exists."; + } + throw new CollaborationException(errorMsg, e); } + try { super.configureVenue(); } catch (CollaborationException e) { @@ -675,7 +681,7 @@ public class SharedDisplaySession extends VenueSession implements } } if (topicOwnershipGranted) { - try{ + try { revokeTopicOwnership(newLeaderId); } catch (XMPPException e1) { log.error( @@ -689,7 +695,7 @@ public class SharedDisplaySession extends VenueSession implements log.warn("Problem releasing ownership of " + revokeTarget + ". " + e.getLocalizedMessage()); } - } + } } /*