inngest-js
inngest-js copied to clipboard
Add an `onError` handler to `run` which is called when a step permanently fails
It would be good to allow users to specify cleanup code for individual steps of a function.
An example:
tools.run(
"Something fragile",
() => {
// This always fails
throw new Error("noooo!");
},
{
onFail: (error: Error) => {
// This runs after the step has been
}
},
});
As @jpwilliams mentioned, this could also be done via try/catch, etc. - the implementation is an open question :)