+ public static ExecutionAnswer error(String message) {
+ return new ExecutionAnswer(ERROR, message);
+ }
+
+ public static ExecutionAnswer error(Throwable e) {
+ StringWriter writer = new StringWriter();
+ try {
+ e.printStackTrace(new PrintWriter(writer));
+ return new ExecutionAnswer(ERROR, writer.toString());
+ } finally {
+ IOUtils.closeQuietly(writer);
+ }
+ }
+
+ public static ExecutionAnswer ok(String message) {
+ return new ExecutionAnswer(OK, message);
+ }
+