Exemple #1
0
        public HttpResponseClientException(HttpErrorClient errorFromServer)
        {
            if (errorFromServer == null)
            {
                throw new ArgumentNullException("errorFromServer");
            }

            _ErrorDictionary = errorFromServer;
            _DetailMessage   = BuildMessage(_ErrorDictionary);
        }
Exemple #2
0
        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());
        }