Esempio n. 1
0
        // Token: 0x060018F6 RID: 6390 RVA: 0x00056C38 File Offset: 0x00054E38
        private GetLinkPreviewResponse CreateErrorResponse(Exception exception)
        {
            string error            = (exception.Data["ErrorKey"] != null) ? exception.Data["ErrorKey"].ToString() : exception.GetType().Name;
            string exceptionMessage = GetLinkPreview.GetExceptionMessage(exception);

            return(this.CreateErrorResponse(error, exceptionMessage));
        }
Esempio n. 2
0
        // Token: 0x060018F4 RID: 6388 RVA: 0x00056B88 File Offset: 0x00054D88
        private GetLinkPreviewResponse CreateErrorResponse(HttpRequestException requestException)
        {
            WebException ex = requestException.InnerException as WebException;

            if (ex != null)
            {
                return(this.CreateErrorResponse(ex));
            }
            string name             = requestException.GetType().Name;
            string exceptionMessage = GetLinkPreview.GetExceptionMessage(requestException);

            return(this.CreateErrorResponse(name, exceptionMessage));
        }
Esempio n. 3
0
        // Token: 0x060018F5 RID: 6389 RVA: 0x00056BC8 File Offset: 0x00054DC8
        private GetLinkPreviewResponse CreateErrorResponse(WebException webException)
        {
            string error;

            if (webException.Status == WebExceptionStatus.ProtocolError)
            {
                string          str             = null;
                HttpWebResponse httpWebResponse = webException.Response as HttpWebResponse;
                if (httpWebResponse != null)
                {
                    str = ((int)httpWebResponse.StatusCode).ToString();
                }
                error = webException.Status.ToString() + str;
            }
            else
            {
                error = webException.Status.ToString();
            }
            string exceptionMessage = GetLinkPreview.GetExceptionMessage(webException);

            return(this.CreateErrorResponse(error, exceptionMessage));
        }