Ejemplo n.º 1
0
        public void Intercepte(ActionProxy actionProxy)
        {
            logger.Debug("exception interceptor, order:" + Order);
            try
            {
                actionProxy.Execute();
            }
            catch (Exception ex)
            {
                logger.Error("ExceptionInterceptor:", ex);

                string        subject = "Action Error, ActionId = " + actionId + ", Exception = " + ex.GetType().Name;
                StringBuilder mesasge = new StringBuilder();
                mesasge.Append("ActionId=").AppendLine(actionId)
                .Append("Environment=").AppendLine(Environment.MachineName)
                .Append("Exception Message=").AppendLine(ex.Message)
                .Append("Exception Trace=").AppendLine(ex.StackTrace)
                .Append("Exception Source=").AppendLine(ex.Source);
                string        from = notifier;
                List <string> to   = notifiedGroups.ToList();

                mailManager.BeginSend(subject, mesasge.ToString(), from, null, to, null, null);
                throw;
            }
        }