mvSapphire / PowerPipe

A library for .NET that uses a fluent interface to construct advanced workflows with ease.
MIT License
193 stars 10 forks source link

Added OnError method to builder; internal steps refactoring #10

Closed mvSapphire closed 1 year ago

mvSapphire commented 1 year ago

I added the ability to add Error handling to steps. Currently added Suppress and Retry error handling, in the future will be added retry policies;

Refactored internal steps;

homolibere commented 1 year ago

it's ok. but i think it would be nice to give abillity to decide how to handle error to developer. i mean currently we can only manage retry policy, but what if we allow developers to pass predicate in OnError(...) which will decide true/false for error handling. We already have context in current error handling function - this is pretty neat if we allow developers to decide fail or not based on context data. For example if we have step with http call and OnError(...) with predicate we can decide if error code was >= 500 && <= 599 - we retry, else fails.

mvSapphire commented 1 year ago

good idea; added optional predicate that indicates that error handling should apply or not