mise
mise copied to clipboard
task error handling
there should be some kind of error handling to execute something when a task fails, perhaps to cancel the error somehow. My use-case for this is I have a bunch of tasks that run and leave the project in an inconsistent state when they fail because it's all running in parallel. There is a specific task that—if failed—I'd like it to reset the contents of a specific file.
Noodling on this:
[tasks.render]
run = "node build-something.js > output"
on_failure = "git checkout output"
I don't personally need to cancel the error—though I feel like with this sort of thing that's probably going to be behavior someone wants—especially if I call this "error handling".
Maybe we could make that an optional setting:
[tasks.render]
run = "node build-something.js > output"
on_failure = {run = "git checkout output", cancel_error = true}
what do other task managers do?