public void OnError(ExceptionContext context) { Console.WriteLine("Error: " + context.Exception.Message); Console.WriteLine(); Parser.Run<CommandLineOptions>( new string[]{} , this); context.ReThrow = false; }
private void HandleError(ExceptionContext context) { #if DEBUG System.Console.WriteLine(context.Exception.ToString()); System.Console.ReadKey(); #endif context.ReThrow = true; }
static void err(ExceptionContext c) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(c.Exception.Message); Console.ResetColor(); }
private static void HandleError(ExceptionContext e) { System.Console.WriteLine("\nUnexpected error occured:" #if DEBUG + "\n" + e.Exception.ToString() #else + e.Exception.GetType().Name + ": " + e.Exception.Message #endif ); }
public static void HandleError(ExceptionContext context) { context.ReThrow = false; Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Red; Exception ex = context.Exception; while (ex != null) { Console.WriteLine("Error: {0} {1}", ex.GetType().Name, ex.Message); ex = ex.InnerException; } Console.ForegroundColor = ConsoleColor.Gray; }
void Error(ExceptionContext c) { Handled = true; }
public void Error(ExceptionContext ex) { ex.ReThrow = true; }
public void Error(ExceptionContext ex) { }
public void Error(ExceptionContext ex) { Handled = true; ex.ReThrow = true; }
private bool TryHandlePrematureError(Exception ex, object[] targets) { var context = new ExceptionContext(ex); if (Register.RegisteredErrorHandler != null) { Register.RegisteredErrorHandler(context); return context.ReThrow; } else { for (int i = 0; i < m_types.Length; i++) { var type = m_types[i]; var errorHandler = ParserRunner.GetDefinedErrorHandlers(type).FirstOrDefault(); if (errorHandler != null) { var target = targets == null ? null : targets[i]; errorHandler.Invoke(target, new[] { context }); return context.ReThrow; } } } return true; }
private bool HandleError(Exception ex, object target) { var context = new ExceptionContext(ex); if (m_registration.RegisteredErrorHandler != null) { m_registration.RegisteredErrorHandler(context); return context.ReThrow; } else { var definedErrorHandlers = GetDefinedErrorHandlers(Type); Debug.Assert(definedErrorHandlers.Count() <= 1); var handler = definedErrorHandlers.FirstOrDefault(); if (handler != null) { MethodInvoker.Invoke(handler, target, new[] { context }); return context.ReThrow; } // no handler - rethrow // return true; } }
public static void Error(ExceptionContext ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(ex.Exception.Message); Console.ResetColor(); }
public void Error(ExceptionContext e) { Log.Error(e.Exception, "An error occurred"); }
public static void HandleError(ExceptionContext context) { Console.WriteLine(Tag + context.Exception.Message + ". Please check the help function"); context.ReThrow = false; }