示例#1
0
        public IActionResult Index(bool throwException = false)
        {
            if (throwException)
            {
                //messenger.Add(new Message(
                //    text: $"Application exception occured @ {DateTimeOffset.UtcNow}.",
                //    title: "Error"));

                messenger.Error(
                    text: $"Application exception occured @ {DateTimeOffset.UtcNow}.",
                    title: "Error");

                throw new Exception("A message has been created. Go back to the previous page and refresh to see the message.");
            }

            return(View());
        }
示例#2
0
 public void SendError(string message)
 {
     _messenger.Error(message);
 }
 private void ShowException(Exception exception)
 {
     Log.Error(exception, "Упс!");
     _mailer.SendMail(GetErrorMail(exception));
     _messenger.Error(exception.GetMessage());
 }