SuperMap.Web.Mapping.SmMapService.CheckForFault C# (CSharp) Method

CheckForFault() private method

private CheckForFault ( DownloadStringCompletedEventArgs e, Exception &ex ) : bool
e System.Net.DownloadStringCompletedEventArgs
ex System.Exception
return bool
        private bool CheckForFault(DownloadStringCompletedEventArgs e, out Exception ex)
        {
            if (e.Cancelled)
            {
                if (this.Failed != null)
                {
                    this.Failed(this, new MapServiceFaultEventArgs { Cancelled = true });
                }
                ex = null;
                return true;
            }
            if (e.Error != null)
            {
                Exception inner = e.Error;
                if (this.Failed != null)
                {
                    if (inner is SecurityException)
                    {
                        inner = new SecurityException(SuperMap.Web.Resources.ExceptionStrings.PolicyFileAvailable, inner);
                    }
                    this.Failed(this, new MapServiceFaultEventArgs { Error = inner });
                }
                ex = inner;
                return true;
            }
            if (e.Result == "null" || String.IsNullOrEmpty(e.Result))
            {
                Exception inner = null;
                if (this.Failed != null)
                {
                    inner = new Exception(ExceptionStrings.ServiceStarted);
                    this.Failed(this, new MapServiceFaultEventArgs { Error = inner });
                }
                ex = inner;
                return true;
            }
            ex = null;
            return false;
        }