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.

4 Replies
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?
@kleinpetr @kleinpetr
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.@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.