Beispiel #1
0
        public void Handle(object sender, ErrorEventArgs e)
        {
            errorCount++;

            Exception ex = e.Error;
            if (ex != null)
            {
                Trace.TraceError("ErrorHandler.Notify: " + FormatError(ex));

                UpdateErrorCount();
                if (action == ErrorAction.Email)
                {
                    TryNotifyingByEmail(ex);
                }
                if (handleWrongClassException)
                {
                    if (ex is HttpUnhandledException)
                        ex = ex.InnerException;
                    if (ex is HttpException)
                        ex = ex.InnerException;
                    if (ex is TargetInvocationException)
                        ex = ex.InnerException;

                    TryHandleWrongClassException(ex);
                }
            }
        }
Beispiel #2
0
		public void Handle(object sender, ErrorEventArgs e)
		{
			errorCount++;

			Exception ex = e.Error;
			if (ex != null)
			{
				Engine.Logger.Error("ErrorHandler.Notify: " + FormatError(ex));

				UpdateErrorCount();
				if (action == ErrorAction.Email)
				{
					TryNotifyingByEmail(ex);
				}
				if (handleWrongClassException)
				{
					if (ex is HttpUnhandledException)
						ex = ex.InnerException;
					if (ex is HttpException)
						ex = ex.InnerException;
					if (ex is TargetInvocationException)
						ex = ex.InnerException;

					TryHandleWrongClassException(ex);
				}
				if (handleSqlException)
				{
					var sex = ex as SqlException;
					if (sex != null)
					{
						// this is a way to recover when lots of writes are going on
						TryHandleSqlException(sex);
					}
				}
			}
		}