modified fix for issue #59
using $error to throw exception from jx9 script
exception type changed to DatabaseScriptLogicalError