public HttpResponseClientException(HttpErrorClient errorFromServer) { if (errorFromServer == null) { throw new ArgumentNullException("errorFromServer"); } _ErrorDictionary = errorFromServer; _DetailMessage = BuildMessage(_ErrorDictionary); }
private string BuildMessage(HttpErrorClient errorDictionary) { StringBuilder detailMessage = new StringBuilder(errorDictionary.Message); if (!string.IsNullOrEmpty(errorDictionary.ExceptionMessage)) { detailMessage.AppendFormat(" ({0})", errorDictionary.ExceptionMessage); } if (!string.IsNullOrEmpty(errorDictionary.MessageDetail)) { detailMessage.AppendLine(); detailMessage.Append(errorDictionary.MessageDetail); } return(detailMessage.ToString()); }