![]() |
Nuke.Cola
|
Static Public Member Functions | |
| static ValueOrError< T > | TryGet< T > (Func< T > getter, Action< Exception >? onFailure=null, Exception[]? previousErrors=null) |
| Try to gwt a value from an input function which may throw an exception. If an exception is thrown then wrap it inside a ValueOrError for others to handle. | |
| static ValueOrError< TResult > | Transform< TResult, TInput > (this ValueOrError< TInput > self, Func< TInput, TResult > transform) |
| Work on the value inside a ValueOrError but only if input ValueOrError is valid. Return aggregated errors otherwise. | |
| static ValueOrError< T > | Else< T > (this ValueOrError< T > self, Func< T > getter, Action< Exception >? onFailure=null) |
| If input ValueOrError is an error then attempt to execute the input getter function (which may also fail) If input ValueOrError is a value then just return that immediately. | |
| static ValueOrError< T > | Else< T > (this ValueOrError< T > self, bool condition, Func< T > getter, Action< Exception >? onFailure=null) |
| If input ValueOrError is an error then attempt to execute the input getter function (which may also fail) only when condition is true. If condition is false or when input ValueOrError is a value then just return that immediately. | |
| static T | Get< T > (this ValueOrError< T > self, string? message=null) |
| Guarantee the result of an input ValueOrError otherwise throw the aggregated exceptions inside the error. | |
| static Attempt | Try (Action action, Action< Exception >? onFailure=null, Exception[]? previousErrors=null) |
| Attempt to try something which may throw an exception. If an exception is thrown then wrap it inside a ValueOrError for others to handle. | |
| static Attempt | Else (this Attempt self, Action action, Action< Exception >? onFailure=null) |
| If input attempt is an error then attempt to execute another input action (which may also fail) | |
| static Attempt | Else (this Attempt self, bool condition, Action action, Action< Exception >? onFailure=null) |
| If input attempt is an error then attempt to execute another input action (which may also fail) only when condition is true. | |
| static void | Assume (this Attempt self, string? message=null) |
| Guarantee that one of the chain of attempts proceeding this function has succeeded otherwise throw the aggregated exceptions inside the error. | |
Definition at line 33 of file ErrorHandling.cs.
|
static |
Guarantee that one of the chain of attempts proceeding this function has succeeded otherwise throw the aggregated exceptions inside the error.
| self | |
| message | Optional message for when input is an error |
Definition at line 184 of file ErrorHandling.cs.
|
static |
If input attempt is an error then attempt to execute another input action (which may also fail)
| self | |
| action | which may throw an exception |
| onFailure | Optionally react to the failure of the action |
Definition at line 154 of file ErrorHandling.cs.
|
static |
If input attempt is an error then attempt to execute another input action (which may also fail) only when condition is true.
| self | |
| condition | Consider fallback only when this condition is true |
| action | which may throw an exception |
| onFailure | Optionally react to the failure of the action |
Definition at line 172 of file ErrorHandling.cs.
|
static |
If input ValueOrError is an error then attempt to execute the input getter function (which may also fail) only when condition is true. If condition is false or when input ValueOrError is a value then just return that immediately.
| self | |
| condition | Consider fallback only when this condition is true |
| getter | The function returning T which may however throw an exception |
| onFailure | Optionally react to the failure of the getter function |
Definition at line 100 of file ErrorHandling.cs.
|
static |
If input ValueOrError is an error then attempt to execute the input getter function (which may also fail) If input ValueOrError is a value then just return that immediately.
| self | |
| getter | The function returning T which may however throw an exception |
| onFailure | Optionally react to the failure of the getter function |
Definition at line 81 of file ErrorHandling.cs.
|
static |
Guarantee the result of an input ValueOrError otherwise throw the aggregated exceptions inside the error.
| self | |
| message | Optional message for when input is an error |
| T |
Definition at line 114 of file ErrorHandling.cs.
|
static |
Work on the value inside a ValueOrError but only if input ValueOrError is valid. Return aggregated errors otherwise.
| self | |
| transform |
| TResult | |
| TInput |
Definition at line 63 of file ErrorHandling.cs.
|
static |
Attempt to try something which may throw an exception. If an exception is thrown then wrap it inside a ValueOrError for others to handle.
| action | which may throw an exception |
| onFailure | Optionally react to the failure of the action |
| previousErrors | Optionally provide previous failures which has led to this one |
Definition at line 131 of file ErrorHandling.cs.
|
static |
Try to gwt a value from an input function which may throw an exception. If an exception is thrown then wrap it inside a ValueOrError for others to handle.
| getter | The function returning T which may however throw an exception |
| onFailure | Optionally react to the failure of the getter function |
| previousErrors | Optionally provide previous failures which has led to this one |
Definition at line 43 of file ErrorHandling.cs.