You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So i have been working on a multistep function where the onFailure logic was different based on the step that failed. I didnt find a way to handle this in inngest
As a workaround , i had to pass the step name property within the error object like below
I think we can handle this issue on inngest level by introducing a new type called InngestStepError which includes the step name (name of failed step) and the original error that was thrown while running the step. So we can throw error like this
throw new InngestStepError({step: "scrape-website"},error)
And handle the onFailure based on step
`
onFailure: async ({ error, event }) => {
switch(error.step) {
case "scrape-website":
// Do Something
break;
case "step-2":
// Do Something
break;
}
}
`
The text was updated successfully, but these errors were encountered:
anasabdullahysfzai
changed the title
Adding type for InngestStepError to handle the onfailure logic based on failed step
[FEATURE]Adding type for InngestStepError to handle the onfailure logic based on failed step
Nov 15, 2023
So i have been working on a multistep function where the onFailure logic was different based on the step that failed. I didnt find a way to handle this in inngest
As a workaround , i had to pass the step name property within the error object like below
throw { step: "scrape-website", error: error_instance }
I think we can handle this issue on inngest level by introducing a new type called
InngestStepError
which includes the step name (name of failed step) and the original error that was thrown while running the step. So we can throw error like thisthrow new InngestStepError({step: "scrape-website"},error)
And handle the onFailure based on step
`
onFailure: async ({ error, event }) => {
switch(error.step) {
case "scrape-website":
// Do Something
break;
case "step-2":
// Do Something
break;
}
}
`
The text was updated successfully, but these errors were encountered: