Skip to content

Releases: kolan72/PoliNorError

2.16.21

27 Mar 19:45
Compare
Choose a tag to compare

Small changes

  • TryCatch/TryCatchBuilder classes now support more than two CatchBlockHandlers.

2.16.20

26 Mar 13:52
Compare
Choose a tag to compare

Improvements

  • Introduce the TryCatch class, which implements the ITryCatch interface with methods for executing sync or async, generic or non-generic delegates that return TryCatchResult(<T>) class (no more than two CatchBlockHandler supported so far).
  • Introduce the ITryCatchBuilder interface and TryCatchBuilder class.
  • Add NonEmptyCatchBlockFilter.ToCatchBlockHandler and CatchBlockForAllHandler.ToTryCatch methods.
  • Add ToTryCatchBuilder and ToTryCatch extension methods to the CatchBlockFilteredHandler class.

Small changes

  • Add CODE_COVERAGE.md.

Docs changes

  • Update 'Calling Func and Action delegates in a resilient manner' README Chapter.

2.16.16

11 Mar 15:14
Compare
Choose a tag to compare

Small changes

  • Hotfix introducing new CatchBlockHandlerFactory class to prevent inconsistent creation of CatchBlockHandler subclasses.

2.16.15

10 Mar 19:07
Compare
Choose a tag to compare

Improvements

  • Introduce the CatchBlockHandler class and the CatchBlockFilteredHandler and CatchBlockForAllHandler subclasses.
  • Introduce new InvokeWithSimple(Async) extension methods with a CatchBlockHandler parameter for non-generic delegates.
  • Introduce new InvokeWithSimple(Async)<T> extension methods with a CatchBlockHandler parameter for generic delegates.
  • Introduce the NonEmptyCatchBlockFilter class.
  • Add the RetryProcessingErrorInfo and RetryProcessingErrorContext classes to process exceptions by a retry processor in a more object-oriented way.

Small changes

  • Add CatchBlockFilter.Empty() static method.
  • Upgrade tests to NUnit.4.1.0.

Docs changes

  • Update 'Calling Func and Action delegates in a resilient manner' README Chapter.
  • Update 'SimplePolicy' README Chapter.

2.16.9

26 Feb 19:21
Compare
Choose a tag to compare

Improvements

  • Add CatchBlockFilter class and use it in the SimplePolicyProcessor class.
  • Introduce new Action.InvokeWithSimple extension method with an CatchBlockFilter parameter.
  • Introduce new Func<CancellationToken, Task>.InvokeWithSimpleAsync extension method with an CatchBlockFilter parameter.
  • Introduce new Func<T>.InvokeWithSimple extension method with an CatchBlockFilter parameter.
  • Introduce new Func<CancellationToken, Task<T>>.InvokeWithSimpleAsync<T> extension methods with an CatchBlockFilter parameter.
  • Delegates, when included as part of PolicyDelegate in a collection, are handled error-free even if a policy rethrows an exception.
  • Set the PolicyResult.ErrorFilterUnsatisfied property to true when a delegate is handled as part of a PolicyDelegate by the PolicyDelegateCollection(T) and an exception is rethrown because the error filter is not satisfied.
  • Force the non-generic async fallback delegate converted from Func<Task> to throw OperationCanceledException if cancellation has already occurred.

Small changes

  • Rename the incorrect filename PolicyProcessorTests.cs to ExceptionFilterTests.cs.

2.16.1

11 Feb 16:53
Compare
Choose a tag to compare

Improvements

  • Introduce IncludeInnerError<TInnerException> and ExcludeInnerError<TInnerException> methods for PolicyCollection.
  • Introduce IncludeInnerError<TInnerException> and ExcludeInnerError<TInnerException> methods for the PolicyDelegateCollection and PolicyDelegateCollection<T> classes.
  • Introduce FallbackFuncsProvider class.
  • New constructors for FallbackPolicy classes that accept the FallbackFuncsProvider parameter.
  • Introduce PolicyCollection.WithFallback(FallbackFuncsProvider) method.
  • Add PolicyCollection.WithFallback overloaded methods with onlyGenericFallbackForGenericDelegate parameter.
  • Refactor the constructors of FallbackPolicy classes to accept the new onlyGenericFallbackForGenericDelegate parameter.
  • Improved performance for FallbackPolicy, since no more Expressions are used to store generic fallback functions.
  • Made SimplePolicyProcessor and SimplePolicy rethrow exception if error filter is unsatisfied.
  • Minimize the number of calls to the Expression.Compile method in the PolicyProcessor.ExceptionFilter class.
  • Introduce PolicyResult.FailedHandlerIndex property.

Bug fixes

  • Fix issue #93.

Small changes

  • Made SimplePolicyProcessor class sealed.

Docs changes

  • Update 'Error processors' README Chapter.
  • Add doc comments to IBulkErrorProcessor, IFallbackProcessor interfaces and FallbackPolicy class.

2.15.0

21 Jan 17:37
Compare
Choose a tag to compare

Improvements

  • Introduce SetPolicyResultFailedIf(<T>) methods for the PolicyCollection and the PolicyDelegateCollection(<T>) classes.
  • Introduce IncludeInnerError<TInnerException> and ExcludeInnerError<TInnerException> methods for policy processors and library policies(RetryPolicy, SimplePolicy and FallbackPolicy).
  • Cross-synchronisation support for invoking a non-generic fallback delegate when a generic one is not set.

Small changes

  • Reduce allocations by using only a single instance of the RetryErrorContext class in Retry processing.
  • Add Apply<T> extension method to Action<T> delegate.
  • Refactor FallbackPolicyBase class.

Docs changes

  • Correct the doc comments for the SetPolicyResultFailedIfInner methods of the library policies.
  • Update 'PolicyResult handlers' README Chapter.

2.14.0

07 Jan 17:02
Compare
Choose a tag to compare

Improvements

  • Introduce WithInnerErrorProcessorOf<TException> overloaded methods for policy processor interfaces, BulkErrorProcessor, library policies(RetryPolicy, SimplePolicy and FallbackPolicy), PolicyDelegateCollection(<T>) and PolicyCollection.
  • Introduce SetPolicyResultFailedIf(<T>) methods for library policies(RetryPolicy, SimplePolicy and FallbackPolicy).

2.12.1

24 Dec 09:59
Compare
Choose a tag to compare

Improvements

  • Introduce IncludeErrorSet<TException1, TException2> and ExcludeErrorSet<TException1, TException2> extension methods for the PolicyDelegateCollection(<T>) classes.
  • Introduce PolicyResult(<T>).CriticalError property.
  • Introduce PolicyResultHandlingException.HandlerIndex property.

Bug fixes

  • Fix issue (#83): the PolicyResult handler index in the collection should be correct when adding generic and non generic handlers consecutively.

Small changes

  • Upgrade tests to Nunit 4.0.1.

Docs changes

  • Update 'Error filters' README Chapter.
  • Edit 'PolicyResult handlers' README Chapter.
  • Edit 'PolicyDelegateCollection' README Chapter.
  • Correct 'Policy wrap' README Chapter example.

2.11.1

10 Dec 18:17
Compare
Choose a tag to compare

Improvements

  • Introduce IncludeErrorSet<TException1, TException2> methods for policy processors, library policies(RetryPolicy, SimplePolicy and FallbackPolicy) and PolicyCollection.
  • Introduce ExcludeErrorSet<TException1, TException2> methods for policy processors, library policies(RetryPolicy, SimplePolicy and FallbackPolicy) and PolicyCollection.

Small changes

  • Slightly improve performance by using the equality operator instead of the Equals method for comparing types in generic error filters.

Docs changes

  • Add new 'PolicyDelegateCollectionResult' README chapter.
  • Update examples in the 'Policy wrap' README chapter.
  • Add docs for the ExcludeError, IncludeError extension methods in the RetryProcessorErrorFiltering, FallbackProcessorErrorFiltering, SimplePolicyProcessorErrorFiltering classes.