Пример #1
0
 public void Handle(ResponseErrorData errorData)
 {
     var exMsg = errorData.Exception.Message;
     var uri = errorData.RequestUri.Replace("http://api.t.sina.com.cn/", string.Empty);
     var content = string.Format(format, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), uri, errorData.HttpMethod, errorData.ErrorCode, exMsg);
     File.AppendAllText("ResponseError.txt", content);
 }
 /// <summary>
 /// Initializes a new instance of <see cref="ResponseErrorEventArgs"/> with the specified parameters.
 /// </summary>
 /// <param name="requestUri">The request uri.</param>
 /// <param name="exception">The exception of <see cref="AMicroblogException"/> type.</param>
 /// <param name="httpMethod">The request method.</param>
 /// <param name="contentType">The request content type.</param>
 public ResponseErrorEventArgs(string requestUri, AMicroblogException exception, string httpMethod, string contentType)
 {
     ErrorData = new ResponseErrorData();
     ErrorData.ErrorCode = exception.ErrorCode;
     ErrorData.RequestUri = requestUri;
     ErrorData.Exception = exception;
     ErrorData.HttpMethod = httpMethod;
     ErrorData.ContentType = contentType;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of <see cref="ResponseErrorEventArgs"/> with the specified parameters.
 /// </summary>
 /// <param name="requestUri">The request uri.</param>
 /// <param name="exception">The exception of <see cref="AMicroblogException"/> type.</param>
 /// <param name="httpMethod">The request method.</param>
 /// <param name="contentType">The request content type.</param>
 public ResponseErrorEventArgs(string requestUri, AMicroblogException exception, string httpMethod, string contentType)
 {
     ErrorData             = new ResponseErrorData();
     ErrorData.ErrorCode   = exception.ErrorCode;
     ErrorData.RequestUri  = requestUri;
     ErrorData.Exception   = exception;
     ErrorData.HttpMethod  = httpMethod;
     ErrorData.ContentType = contentType;
 }
 public void Handle(ResponseErrorData errorData)
 {
     throw new NotImplementedException();
 }