/// <summary> /// Handle instances of WebException, try to convert to SessionException and throw /// </summary> /// <param name="e">indicating the web exception</param> internal static void HandleWebException(WebException e) { Exception ex = WebAPIUtility.ConvertWebException(e); FaultException <SessionFault> fe = ex as FaultException <SessionFault>; if (fe != null) { throw Utility.TranslateFaultException(fe); } else { throw ex; } }
/// <summary> /// Close session /// </summary> /// <param name="sessionId">indicating the session id</param> void IBrokerLauncher.Close(string sessionId) { try { HttpWebRequest request = SOAWebServiceRequestBuilder.GenerateCloseSessionWebRequest(this.headNode, sessionId, this.credential); using (request.GetResponse()) { } } catch (WebException e) { SessionBase.TraceSource.TraceEvent(System.Diagnostics.TraceEventType.Error, 0, "[WebBrokerLauncherClient] Exception thrown while closing broker: {0}", e); Exception ex = WebAPIUtility.ConvertWebException(e); if (ex is FaultException <SessionFault> ) { // Bug 16075: Ignore session fault when closing broker } else { throw ex; } } }