Exemplo n.º 1
0
        /// <summary>
        /// Execute the configured Critical error action.
        /// </summary>
        /// <param name="message">Error message</param>
        /// <param name="exception">The critical exception thrown.</param>
        public static void Raise(string message, Exception exception)
        {
            Logger.Fatal("{0} :\n{1}", message, exception.GetFullExceptionMessage());

            RaiseEvent(message, exception);

            onCriticalErrorAction(message, exception);
        }
Exemplo n.º 2
0
        private static void OnCriticalError(string message, Exception exception)
        {
            if (Environment.UserInteractive)
            {
                Console.WriteLine("Hermes Service Host is shutting down due to a fatal error. Press any key to exit.");
                Console.ReadKey();
            }

            Environment.FailFast(String.Format("{0}\n{1}", message, exception.GetFullExceptionMessage()), exception);
        }
 public static void Trigger(Exception ex, string message)
 {
     Logger.Error(String.Format("{0}:\n{1}", message, ex.GetFullExceptionMessage()));
     CircuitBreaker.Execute(() => CriticalError.Raise(message, ex));
 }
        public static void Trigger(Exception ex)
        {
            Logger.Error(ex.GetFullExceptionMessage());

            CircuitBreaker.Execute(() => CriticalError.Raise("Sytem Circuit Breaker Triggered", ex));
        }
Exemplo n.º 5
0
 private void OnRetryError(Exception ex)
 {
     logger.Warn("Error while processing in memory message, attempting retry : {0}", ex.GetFullExceptionMessage());
 }
Exemplo n.º 6
0
        private static void OnCriticalError(string message, Exception exception)
        {
            string log = String.Format("{0}\n{1}", message, exception.GetFullExceptionMessage());

            try
            {
                logger.Fatal(log);
            }
            catch
            {
                Console.WriteLine(@"{0}", log);
            }
            finally
            {
                if (Environment.UserInteractive)
                {
                    Console.WriteLine("\nHermes Service Host is shutting down due to a fatal error. Press any key to exit.");
                    Console.ReadKey();
                    Environment.Exit(-1);
                }

                Environment.FailFast(log, exception);
            }
        }
        public static void WriteError(string message, System.Exception ex = null, string additionalInformation = null)
        {
            //TODO: Log error

            System.Diagnostics.Debug.WriteLine(message);

            if (ex != null)
            {
                System.Diagnostics.Debug.WriteLine(string.Format("--------\r\n{0}\r\n--------", ex.GetFullExceptionMessage()));
            }
        }