]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/GigiApiException.java
[DB]: Add orgAdmin management code
[gigi.git] / src / org / cacert / gigi / GigiApiException.java
index 430c199befb11bc916c3d84fb7e98247fd04923e..e766d9ea9e6e56b50fa87ec69c61924da05f4c7a 100644 (file)
@@ -4,11 +4,13 @@ import java.io.PrintWriter;
 import java.sql.SQLException;
 import java.util.LinkedList;
 
+import org.cacert.gigi.localisation.Language;
+
 public class GigiApiException extends Exception {
 
-    SQLException e;
+    private SQLException e;
 
-    LinkedList<String> messages = new LinkedList<>();
+    private LinkedList<String> messages = new LinkedList<>();
 
     public GigiApiException(SQLException e) {
         super(e);
@@ -56,4 +58,16 @@ public class GigiApiException extends Exception {
         return e == null && messages.size() == 0;
     }
 
+    @Override
+    public String getMessage() {
+        if (messages.size() != 0) {
+            StringBuffer res = new StringBuffer();
+            for (String string : messages) {
+                res.append(string + "\n");
+            }
+            return res.toString();
+        }
+        return "";
+    }
+
 }