Is it possible to throw a friendly notification of known error from camunda when complete a task in workflow service

Hello,
When I call the api /api/task/{id}/complete of the workflow service, if there is an exception from workflow camunda, it always throws not found exception 404 Could not complete task with id {taskId} with variables {document}.
In our case, the exception is a known error from the camunda delegate, and we wish to show it as a friendly notification to user.
Is it possible to make it work or is there anything work around for it?
Thank you.

Current using
workflowsVersion=8.0.4
camundaVersion=7.17.0
dataServicesVersion=34.1.2

Hi Quynh,

We wrap Camunda’s 500 error into a 404 response. How would you identify that your “known error from the camunda delegate” is the cause based on the original error from Camunda?

In other words, what information from the Camunda response would you need us to expose to our response?

Cheers,
Peter

Hello Peter,

It is not the original error from Camunda. But it is our business error in the workflow delegate.

Our case is we have a special configuration for users. At some point, they can only proceed the task only if they have that configuration (currently manually config by us via database). So in the delegate, if the user does not have that config, we will throw an exception (with the message) and we want to show that message for the user so they know what to do.
I also don’t know if it is the correct way to handle this issue. I really appreciate it if there is any solution to it.

Thank you

Hi Quynh,

What kind of exception are you throwing exactly? Do you mean “business error” in the sense of org.camunda.bpm.engine.delegate.BpmnError?

I’m expecting that you’ll have to create a requirement ticket for us. Then we’ll see how we can expose the information you need.

@laman-rocky-clover will follow up since I’ll be off for a few weeks.