Elegant error messages from Scripting?

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?

throw "Error Message Goes here";

Tasklist response:


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.