Currently, the main way that recipes express failures is by raising a step.StepFailure exception. This is somewhat overloaded, as seen by looking at the constructor of that exception.
Ideally, there would be two exception classes:
StepFailure, which is used when an actual step fails
RecipeFailure (name TBD), which will be used when something else fails, and the build needs to stop.
These would each have very simple constructors, and would also be able to be surfaced in the result proto very clearly.
The rollout of this change might be complicated, as there are many places that use StepFailure which probably should use RecipeFailure. https://cs.chromium.org/chromium/infra/recipes-py/recipe_modules/cipd/api.py?l=238 is an example of this.
Comment 1 by iannu...@google.com
, Oct 5