예제 #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();
     }
 }
예제 #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);
     }
 }
예제 #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);
        }
예제 #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();
            }
        }
예제 #5
0
 ObjectCreationExpression(
     exception,
     ArgumentList(
예제 #6
0
 // Act
 await exchangeService.SubscribeStatistics(Exchange.Test, symbols, exception, cxlToken);
예제 #7
0
 _ => new Failure(FailureId.Other, $"Error: {ExtractExceptionMessage(exception, fullException)}")
예제 #8
0
파일: Log.cs 프로젝트: wolfet/shiny
 errorSubj.OnNext(new LogError(exception, parameters));
예제 #9
0
파일: Log.cs 프로젝트: dorisoy/Shiny
 errorSubj.OnNext(new LogError(exception, parms));
예제 #10
0
 public static readonly CreateManagerDelegate DefaultCreateManagerDelegate = new CreateManagerDelegate( (exception)=>{ return new Manager(exception);
예제 #11
0
 _ => ServerProblem(exception, StatusCodes.Status500InternalServerError)
 OnWarning(exception, message);