just icon indicating copy to clipboard operation
just copied to clipboard

Add [custom-exit-message(PROMPT] to simplify providing custom errror messages

Open WojciechSzade opened this issue 2 months ago • 3 comments

Allowing users to change the default recipe failed message to any custom message would make providing custom feedback to failing recipes much easier.

If we could overwrite the default "error: Recipe `{recipe}` failed on line {line} with exit code 1" message with our custom message, it would be very helpful.

It would work analogically to [no-exit-message], but instead would provide a custom fail message.

WojciechSzade avatar Oct 17 '25 12:10 WojciechSzade

+1

davidgfitzgerald avatar Oct 23 '25 09:10 davidgfitzgerald

I'm not sure about this one. I understand the intent, but it's unclear to me that a fixed error message is useful. Recipes often have multiple lines, and any line may fail. In addition, a line may fail for multiple reasons. A custom error message is only likely to cover one possible failure, and may be otherwise unhelpful.

casey avatar Oct 25 '25 20:10 casey

I'm not sure about this one. I understand the intent, but it's unclear to me that a fixed error message is useful. Recipes often have multiple lines, and any line may fail. In addition, a line may fail for multiple reasons. A custom error message is only likely to cover one possible failure, and may be otherwise unhelpful.

Some recipes for sure are complex and fixed error messages may be unhelpful.
But some are simple.
And some might frequently fail for a specific reason - so customizing the error message might be really helpful.
Also - the generic recipe failed prompt is not really useful as well. One could also modify it for the sake of preference.
Making the message more meaningful could also be available by making different custom prompts for recipes that depend on the recipe we run (might also use private recipes with fail messages) and the error messages then could stack (if I run recipe B that depends on A and A fails I get a message like - message A... which caused message B.)

WojciechSzade avatar Oct 25 '25 21:10 WojciechSzade