|
|
Result handling policies. More...
Classes | |
| class | Continue |
| Ignore any skill outcome and just continue. More... | |
| class | Escalate |
| Escalate any failures by throwing an exception. More... | |
| class | WarnOnFailureAndContinue |
| Print a warning on failure but continue in any case. More... | |
Result handling policies.
These policies are meant to be used to handle common use-cases in handling outputs of skill executions to avoid boilerplate. Since the skill outputs should be std::expected and expected is defined as [[nodiscard]], unhandled outputs will result in compiler warnings. Thus, to get rid of the warnings, the output must be stored in a local variable and handled as such:
The purpose of these policies is to allow skill business object authors to define operators to handle common use-cases in a one liner. Specifically, by overwriting operator||() and the given policy as parameter as follows:
a fluent skill execution can be written that handles the outcome as follows:
The currently supported policies are defined in this namespace. The skill business object author is responsible for supplying these overloads if they want to support this feature.