Catel.ExceptionHandling.ExceptionHandler.Handle C# (CSharp) Метод

Handle() публичный Метод

Handles the exception using the action that was passed into the constructor.
The is null.
public Handle ( Exception exception ) : void
exception System.Exception The exception.
Результат void
        public void Handle(Exception exception)
        {
            Argument.IsNotNull("exception", exception);

            if (Filter != null && Filter.Invoke(exception))
            {
                _action(exception);
                return;
            }
            
            if (Filter == null)
            {
                _action(exception);
                return;
            }

            throw exception;
        }
        #endregion

Usage Example

Пример #1
0
            public void PerformsHandle()
            {
                var originalException = new ArgumentException("achieved");
                var message = string.Empty;
                var handler = new ExceptionHandler(typeof (ArgumentException), exception => { message = exception.Message; });
                handler.Handle(originalException);

                Assert.AreEqual("achieved", message);
            }
All Usage Examples Of Catel.ExceptionHandling.ExceptionHandler::Handle