We’ve integrated temporal with our web app such that it’s used to process some long-running api requests and report their progress back to the app when done. I’d like to give developers a way to handle “bad user input” such that:
- it won’t fail the workflow (workflow failures are something we monitor for operational reasons and have found it a helpful way to discover bugs in our workflows/activities, i’d like these “bad user input” / validation errors not to create noise, since they’d be “expected” error conditions, similar to how HTTP 4XX would typically be ignored but HTTP 5XX would not)
- but i can still hook into it from an interceptor (i’d like to execute some logic that marks the corresponding job in our app as “failed input validation”, with the appropriate user-facing error message)
- Dev ideally could signal this from the workflow or an activity
I’d been trying to just throw a custom exception and catch that in an interceptor, but that causes the workflow to be marked as a failure.
The only other way I can think of to do this involves returning special validation failure indicators and tedious checking of the return value from every activity call.
Hopefully I’m missing something obvious and you all have some suggestions here! Appreciate it.