Esempio n. 1
0
 public TwitterException(
     IWebExceptionInfoExtractor webExceptionInfoExtractor,
     IWebRequestResult webRequestResult)
     : this(webRequestResult.URL)
 {
     StatusCode = webRequestResult.StatusCode;
     TwitterExceptionInfos = webExceptionInfoExtractor.GetTwitterExceptionInfosFromStream(webRequestResult.ResultStream);
     TwitterDescription = webExceptionInfoExtractor.GetStatusCodeDescription(StatusCode);
 }
Esempio n. 2
0
 public TwitterException(
     IWebExceptionInfoExtractor webExceptionInfoExtractor,
     IWebRequestResult webRequestResult)
     : this(webRequestResult.URL)
 {
     StatusCode            = webRequestResult.StatusCode;
     TwitterExceptionInfos = webExceptionInfoExtractor.GetTwitterExceptionInfosFromStream(webRequestResult.ResultStream);
     TwitterDescription    = webExceptionInfoExtractor.GetStatusCodeDescription(StatusCode);
 }
Esempio n. 3
0
 public TwitterException(
     IWebExceptionInfoExtractor webExceptionInfoExtractor,
     ITwitterResponse twitterResponse,
     ITwitterRequest request)
     : this(request)
 {
     StatusCode            = twitterResponse.StatusCode;
     TwitterExceptionInfos = webExceptionInfoExtractor.GetTwitterExceptionInfosFromStream(twitterResponse.ResultStream);
     TwitterDescription    = webExceptionInfoExtractor.GetStatusCodeDescription(StatusCode);
 }
Esempio n. 4
0
 public TwitterException(
     IWebExceptionInfoExtractor webExceptionInfoExtractor,
     WebException webException,
     ITwitterRequest request)
     : this(request, webException.Message)
 {
     WebException          = webException;
     StatusCode            = webExceptionInfoExtractor.GetWebExceptionStatusNumber(webException);
     TwitterExceptionInfos = webExceptionInfoExtractor.GetTwitterExceptionInfo(webException);
     TwitterDescription    = webExceptionInfoExtractor.GetStatusCodeDescription(StatusCode);
 }
Esempio n. 5
0
 public TwitterException(
     IWebExceptionInfoExtractor webExceptionInfoExtractor,
     WebException webException,
     string url)
     : this(url)
 {
     WebException          = webException;
     StatusCode            = webExceptionInfoExtractor.GetWebExceptionStatusNumber(webException);
     TwitterExceptionInfos = webExceptionInfoExtractor.GetTwitterExceptionInfo(webException);
     TwitterDescription    = webExceptionInfoExtractor.GetStatusCodeDescription(StatusCode);
 }
Esempio n. 6
0
 public TwitterException(
     IWebExceptionInfoExtractor webExceptionInfoExtractor,
     WebException webException,
     ITwitterQuery twitterQuery,
     int defaultStatusCode = DEFAULT_STATUS_CODE)
     : this(twitterQuery, webException.Message)
 {
     WebException          = webException;
     StatusCode            = webExceptionInfoExtractor.GetWebExceptionStatusNumber(webException, defaultStatusCode);
     TwitterExceptionInfos = webExceptionInfoExtractor.GetTwitterExceptionInfo(webException);
     TwitterDescription    = webExceptionInfoExtractor.GetStatusCodeDescription(StatusCode);
 }
Esempio n. 7
0
 public TwitterException(
     IWebExceptionInfoExtractor webExceptionInfoExtractor,
     WebException webException,
     string url)
 {
     CreationDate          = DateTime.Now;
     WebException          = webException;
     URL                   = url;
     StatusCode            = webExceptionInfoExtractor.GetWebExceptionStatusNumber(webException);
     TwitterExceptionInfos = webExceptionInfoExtractor.GetTwitterExceptionInfo(webException);
     TwitterDescription    = webExceptionInfoExtractor.GetStatusCodeDescription(StatusCode);
 }
Esempio n. 8
0
        public TwitterException(
            IWebExceptionInfoExtractor webExceptionInfoExtractor,
            ITwitterResponse twitterResponse,
            ITwitterRequest request)
            : this(request, twitterResponse.ReasonPhrase)
        {
            StatusCode = twitterResponse.StatusCode;
            if (twitterResponse.ResultStream != null)
            {
                using (var reader = new StreamReader(twitterResponse.ResultStream))
                {
                    Content = reader.ReadToEnd();
                    TwitterExceptionInfos = webExceptionInfoExtractor.GetTwitterExceptionInfos(Content);
                }
            }

            TwitterDescription = webExceptionInfoExtractor.GetStatusCodeDescription(StatusCode);
        }
Esempio n. 9
0
 public TwitterException(
     IWebExceptionInfoExtractor webExceptionInfoExtractor,
     WebException webException,
     string url)
     : this(url, webException.Message)
 {
     WebException = webException;
     StatusCode = webExceptionInfoExtractor.GetWebExceptionStatusNumber(webException);
     TwitterExceptionInfos = webExceptionInfoExtractor.GetTwitterExceptionInfo(webException);
     TwitterDescription = webExceptionInfoExtractor.GetStatusCodeDescription(StatusCode);
 }