public void OnError(ExceptionContext context)
 {
     Console.WriteLine("Error: " + context.Exception.Message);
     Console.WriteLine();
     Parser.Run<CommandLineOptions>( new string[]{} , this);
     context.ReThrow = false;
 }
예제 #2
0
        private void HandleError(ExceptionContext context)
        {
#if DEBUG
            System.Console.WriteLine(context.Exception.ToString());
            System.Console.ReadKey();
#endif
            context.ReThrow = true;
        }
예제 #3
0
        static void err(ExceptionContext c)
        {
            Console.ForegroundColor = ConsoleColor.Red;

            Console.WriteLine(c.Exception.Message);

            Console.ResetColor();
        }
예제 #4
0
		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
);
		}
예제 #5
0
        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;
        }
예제 #6
0
파일: Samples.cs 프로젝트: stemarie/CLAP
 void Error(ExceptionContext c)
 {
     Handled = true;
 }
예제 #7
0
파일: Samples.cs 프로젝트: stemarie/CLAP
 public void Error(ExceptionContext ex)
 {
     ex.ReThrow = true;
 }
예제 #8
0
파일: Samples.cs 프로젝트: stemarie/CLAP
 public void Error(ExceptionContext ex)
 {
 }
예제 #9
0
파일: Samples.cs 프로젝트: stemarie/CLAP
        public void Error(ExceptionContext ex)
        {
            Handled = true;

            ex.ReThrow = true;
        }
예제 #10
0
        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;
        }
예제 #11
0
파일: ParserRunner.cs 프로젝트: serra/CLAP
        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;
            }
        }
예제 #12
0
파일: Program.cs 프로젝트: serra/CLAP
 public static void Error(ExceptionContext ex)
 {
     Console.ForegroundColor = ConsoleColor.Red;
     Console.WriteLine(ex.Exception.Message);
     Console.ResetColor();
 }
예제 #13
0
 public void Error(ExceptionContext e)
 {
     Log.Error(e.Exception, "An error occurred");
 }
예제 #14
0
파일: Program.cs 프로젝트: digiwiz1/KodiNFO
 public static void HandleError(ExceptionContext context)
 {
     Console.WriteLine(Tag + context.Exception.Message + ". Please check the help function");
     context.ReThrow = false;
 }