private static void WriteException(Exception ex) { using (var writer = new StringWriter()) { exception ee = new exception(ex); System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(ee.GetType()); x.Serialize(writer, ee); var xmlEncodedList = writer.GetStringBuilder().ToString(); XmlTextReader myXml = new XmlTextReader(new StringReader(xmlEncodedList)); XPathDocument xDoc = new XPathDocument(myXml); XPathNavigator myNav = xDoc.CreateNavigator(); TraceLogger.TraceData(System.Diagnostics.TraceEventType.Error, 0, myNav); TraceLogger.Flush(); } }
internal exception(Exception ex) { ExceptionType = ex.GetType().ToString(); appDomain = AppDomain.CurrentDomain.FriendlyName; Message = ex.Message; StackTrace = ex.StackTrace == null ? " - " : ex.StackTrace.ToString(); HelpLink = ex.HelpLink == null ? " - " : ex.HelpLink.ToString(); TargetSite = ex.TargetSite == null ? " - " : ex.TargetSite.ToString(); Source = ex.Source == null ? " - " : ex.Source.ToString(); ExceptionString = ex.ToString(); if (ex.InnerException != null) { InnerException = new exception(ex.InnerException); } }
internal bool TrySetException(object item) { bool result = false; exception exception = item as exception; if (exception != null) { result = true; StringBuilder txt = new StringBuilder(); exception.Text.Each(s => { txt.Append(s); }); this.Exception = txt.ToString(); if (exception.Items != null) { AddItems(exception.Items); } } return(result); }
private static void updatedbwithexception(exception ex) { string connectionstring = @"data source = (localdb)\projectsv13; initial catalog = twentyonegame; integrated security = true; connect timeout = 30; encrypt = false; trustservercertificate = false; applicationintent = readwrite; multisubnetfailover = false"; string querystring = @"insert into exceptions (exceptiontype, exceptionmessage, timestamp) values (@exceptiontype, @exceptionmessage, @timestamp)"; using (sqlconnection connection = new sqlconnection(connectionstring)) { sqlcommand command = new sqlcommand(querystring, connection); command.parameters.add("@exceptiontype", sqldbtype.varchar); command.parameters.add("@exceptionmessage", sqldbtype.varchar); command.parameters.add("@timestamp", sqldbtype.datetime); command.parameters["@exceptiontype"].value = ex.gettype().tostring(); command.parameters["@exceptionmessage"].value = ex.message; command.parameters["@timestamp"].value = datetime.now; connection.open(); command.executenonquery(); connection.close(); } }
ObjectCreationExpression( exception, ArgumentList(
// Act await exchangeService.SubscribeStatistics(Exchange.Test, symbols, exception, cxlToken);
_ => new Failure(FailureId.Other, $"Error: {ExtractExceptionMessage(exception, fullException)}")
errorSubj.OnNext(new LogError(exception, parameters));
errorSubj.OnNext(new LogError(exception, parms));
public static readonly CreateManagerDelegate DefaultCreateManagerDelegate = new CreateManagerDelegate( (exception)=>{ return new Manager(exception);
_ => ServerProblem(exception, StatusCodes.Status500InternalServerError)
OnWarning(exception, message);