You can use the script errors editor to define errors that can be thrown by a script and handled by the process. Error definitions allow scripts to communicate exceptional conditions, such as validation failures or processing errors, to BPMN error handling events.
To add a script error:
The window is closed and you are brought back to the script
editor. To edit, add, or remove errors, open the Script Errors
dialog box again.