コード例 #1
0
ファイル: ErrorHandler.cs プロジェクト: EdutechSRL/Adevico
        private static ErrorMessage CreateErrorMessage(NotificationAction action, NotificationException error)
        {
            ErrorMessage obj = CreateErrorMessage(action, error.Type);

            obj.Error.StackTrace     = error.StackTrace;
            obj.Error.Source         = error.Source;
            obj.Error.Message        = error.Message;
            obj.Error.InnerException = (error.InnerException == null) ? "" : error.InnerException.Message;
            return(obj);
        }
コード例 #2
0
ファイル: ErrorHandler.cs プロジェクト: EdutechSRL/Adevico
 public static void addActionToPoisonQueue(NotificationAction action, NotificationException error, String poisonQueue = "")
 {
     if (String.IsNullOrEmpty(poisonQueue))
     {
         poisonQueue = System.Configuration.ConfigurationManager.AppSettings["PoisonErrorsQueueName"];
     }
     if (null != error && !String.IsNullOrEmpty(poisonQueue))
     {
         MessageQueue poisonMessageQueue = new MessageQueue(poisonQueue);
         if (poisonMessageQueue != null)
         {
             using (TransactionScope txScope = new TransactionScope(TransactionScopeOption.RequiresNew))
             {
                 poisonMessageQueue.Send(CreateErrorMessage(action, error), MessageQueueTransactionType.Single);
                 txScope.Complete();
             }
         }
     }
 }