Ejemplo n.º 1
0
 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();
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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();
            }
        }
Ejemplo n.º 5
0
 ObjectCreationExpression(
     exception,
     ArgumentList(
Ejemplo n.º 6
0
 // Act
 await exchangeService.SubscribeStatistics(Exchange.Test, symbols, exception, cxlToken);
Ejemplo n.º 7
0
 _ => new Failure(FailureId.Other, $"Error: {ExtractExceptionMessage(exception, fullException)}")
Ejemplo n.º 8
0
Archivo: Log.cs Proyecto: wolfet/shiny
 errorSubj.OnNext(new LogError(exception, parameters));
Ejemplo n.º 9
0
Archivo: Log.cs Proyecto: dorisoy/Shiny
 errorSubj.OnNext(new LogError(exception, parms));
Ejemplo n.º 10
0
 public static readonly CreateManagerDelegate DefaultCreateManagerDelegate = new CreateManagerDelegate( (exception)=>{ return new Manager(exception);
Ejemplo n.º 11
0
 _ => ServerProblem(exception, StatusCodes.Status500InternalServerError)
 OnWarning(exception, message);