NonRetryableError

I am trying to end up workflow with custom error, so I used NonRetryableError outside of step, but the the message was not used as an error.
No description
No description
4 Replies
Olga Silva
Olga Silva2d ago
Hey, this is the expected behavior. NonRetryableErrors are expected to be thrown inside of step.do() - because they prevent steps from being retried effectively finishing the instance run with an Errored status. But it seems you're throwing that error outside of a step - and for that case you could just throw a normal Error? Or create a custom error of your own?
No description
Mohdsyam
Mohdsyam2d ago
@kleinpetr @kleinpetr
kleinpetr
kleinpetrOP2d ago
thanks, let me try 🙂 alright, throw new Error('custom erro') works fine 👍 another question, is it possible to set an output while the workflow is not ended up? I mean emit some output before waitForEvent, e.g. "Waiting for users response" which we could show in the UI.
Olga Silva
Olga Silva2d ago
@kleinpetr No, the output is the end result from your instance. We are however working on developing a better UI with logs! In the meanwhile you could have the waitForEvent step name be that message you want to see on the UI.

Did you find this page helpful?