-
How can I mark a current task as failed? If I e.g. need to execute os commands inside the task and these commands return zero on success and otherwise non-zero, how can I turn these return values into mill task success or failure? I can of course throw exception in case of non-zero return value to avoid the creation of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Thrown exceptions are automatically lifted to |
Beta Was this translation helpful? Give feedback.
Thrown exceptions are automatically lifted to
Result.Exception
. Alternatively, you can explicitly return aResult.Failure
and give a meaningful error message. The only downside is, that the compiler is no longer automatically converting the success case into a Result, so you need to wrap the successful return value in aResult.Success
.