Fix issues with security dependencies
[lgpl/argeo-commons.git] / server / runtime / org.argeo.server.core / src / main / java / org / argeo / server / ServerAnswer.java
index c3e747608dcf10fc264ca87ecbdc4127c5829482..163cdf87fc402a4c55a2de0192fb773baa41bde0 100644 (file)
@@ -4,6 +4,7 @@ import java.io.PrintWriter;
 import java.io.StringWriter;
 
 import org.apache.commons.io.IOUtils;
+import org.argeo.ArgeoException;
 
 /** Answer to an execution of a remote service which performed changes. */
 public class ServerAnswer {
@@ -17,7 +18,7 @@ public class ServerAnswer {
        public ServerAnswer(String status, String message) {
                setStatus(status);
                if (message == null)
-                       throw new ArgeoServerException("Message cannot be null");
+                       throw new ArgeoException("Message cannot be null");
                this.message = message;
        }
 
@@ -31,7 +32,7 @@ public class ServerAnswer {
 
        public void setStatus(String status) {
                if (status == null || (!status.equals(OK) && !status.equals(ERROR)))
-                       throw new ArgeoServerException("Bad status format: " + status);
+                       throw new ArgeoException("Bad status format: " + status);
                this.status = status;
        }
 
@@ -69,4 +70,9 @@ public class ServerAnswer {
                return new ServerAnswer(OK, message);
        }
 
+       @Override
+       public String toString() {
+               return "ServerAnswer{status:" + status + ", message:" + message + "}";
+       }
+
 }