Activiti shows "An unknown error occurred" instead of known error message

Description

ACS 6.2.2
A customer has many custom Activiti workflows that do input validation check using JavaScript Task Listeners on event complete and throw the validation error.
This user will then see the error on the Share UI popup.

An example would be to have `throw ("Hello, world!")` and the popup will display something like the following:

It was previously working in ACS 5.1.2, but since the upgrade to 6.2.2, it only worked for the start task (which uses execution listener), while all other tasks show the following message:

The customer requested to re-enable the actual error message shown in the Share UI when they throw an error in JavaScript Task Listener instead of showing an unknown error.

Steps to reproduce:

1. Download the built-in Activiti adhoc.bpmn20.xml workflow from activiti-admin

2. Add the following code into <startEvent> element to throw an error when message is empty

3. Add the following code to throw an error in the "adhocTask" user task under the <extensionElements> element

4. Upload the new adhoc.bpmn20.xml file into activiti admin

5. Log in to Share, go to the start workflow page and select "New Task"

6. set yourself as the "assign to" user, leave the message blank and try to start the workflow
(there should be a pop up that says, "Message cannot be blank!")

7. Fill in the "message" and start the workflow

8. Go to the task that you have been assigned, and click on "Task Done"

Expected result:
Popup should show "This is a known error!"

Observed result:
The popup shows,

Environment

None

Testcase ID

None

Assignee

Unassigned

Reporter

Shilpa Tupe

ACT Numbers

00385725

Regression Since

5.1.2

Bug Priority

Category 2