public ExceptionResult(Exception exception) : this(exception.GetType().FullName, exception.GetType().Name, exception.Message, exception.StackTrace, null) { if (exception.InnerException != null) { InnerExceptionResult = new ExceptionResult(exception.InnerException); } }
public ExceptionResult(string fullTypeName, string typeName, string message, string stackTrace, ExceptionResult innerExceptionResult) { this.FullTypeName = fullTypeName; this.TypeName = typeName; this.Message = message; this.StackTrace = stackTrace; this.InnerExceptionResult = innerExceptionResult; }
public static Result Parse(string resultXml) { var document = XDocument.Parse(resultXml); var status = document.SafeGet <Status>("/result/status"); var result = new Result(status); var exceptionresult = document.XPathSelectElement("/result/exception/exceptionresult"); if (exceptionresult != null) { result.Exception = ExceptionResult.Parse(exceptionresult.ToString()); } foreach (XElement supplement in document.XPathSelectElements("/result/supplements/supplement")) { string key = supplement.Attribute("key").Value; Dictionary <string, string> supplements = supplement.Elements("entry").ToDictionary(x => x.Attribute("key").Value, x => x.Value); result.Supplements.Add(key, supplements); } return(result); }