# Elegant error messages from Scripting?

**URL:** <https://forum.camunda.io/t/elegant-error-messages-from-scripting/1179>\
**Category:** Discussion & Questions\
**Tags:** process-engine\
**Created:** [July 22, 2016, 5:46pm UTC](https://forum.camunda.io/t/elegant-error-messages-from-scripting/1179 "2016-07-22T17:46:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![StephenOTT](https://forum.camunda.io/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@StephenOTT](https://forum.camunda.io/u/StephenOTT)\
**Post date:** [July 22, 2016, 5:46pm UTC](https://forum.camunda.io/t/elegant-error-messages-from-scripting/1179/1 "2016-07-22T17:46:12Z")

</div>

When scripting (say in JS), and you want to throw an exception/error so that a rollback occurs, the messaging returned through Tasklist is fairly generic and un-clean.

Is there a more elegant way to throw exceptions through scripting?

JS:  
`throw "Error Message Goes here";`

Tasklist response:

 ![](https://forum.camunda.io/uploads/default/original/1X/ec359ea71055250e905a74111e102d2f6417c9d7.png)

Thanks!

edit: I figure we can always make our own error object for reuse, but just looking to see if something exists. Did not see anything in the javadocs the looked like a fit.

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [January 30, 2024, 10:38am UTC](https://forum.camunda.io/t/elegant-error-messages-from-scripting/1179/2 "2024-01-30T10:38:34Z")

</div>

Closed on January 30, 2024, 10:38am UTC


