catch Throwable for Groovy scripts