String (GroovyRuntimeException exception) { String message;StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); exception.printStackTrace(writer); message = stringWriter.getBuffer().toString(); return message; }