Exemple #1
0
 static void withErrorsLogged(Action action)
 {
     try {
         action();
     } catch (Exception e) {
         LogC.err("exception caught from timer", e);
     }
 }
Exemple #2
0
 public void testLogStackTrace()
 {
     try {
         throw new Exception("outer", new NullReferenceException("inner"));
     } catch (Exception e) {
         LogC.err("logc err", e);
     }
 }
Exemple #3
0
        static void handleEachError <T>(IEnumerable <T> items, int i, T current, Exception e)
        {
            var currentStr = "tostring failed.";

            try {
                currentStr = current.ToString();
            } catch (Exception tose) {
                LogC.err("tostring on item failed", tose);
            }
            throw Bomb.toss("failed@" + i + ", processing: " + currentStr + " in " + toShortString(items), e);
        }
Exemple #4
0
 [SetUp] public void setUpWithTeardown()
 {
     try {
         LogC.consoleOut("setUpWithTeardown");
         LogC.setOut("setup " + this, null, false);
         LogC.setVerboseLoggingForever(true);
         LogC.info("Starting " + this);
         Log.info("Starting " + this);
         setUp();
     }  catch {
         try {
             tearDown();
         } catch (Exception e) {
             LogC.err("failed in teardown after failing in setup! ", e);
         }
         throw;
     }
 }
Exemple #5
0
 public static void err(string s)
 {
     LogC.err(s);
 }