X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2FGigiApiException.java;h=430c199befb11bc916c3d84fb7e98247fd04923e;hb=48b552dcb661a6ba039e6b28bea50655667c70f9;hp=7b91d125fb1d200a4e1a822ab7dac70bbf3a693a;hpb=9b8c6af2b684cee31142449955b83ae66cb9ab34;p=gigi.git diff --git a/src/org/cacert/gigi/GigiApiException.java b/src/org/cacert/gigi/GigiApiException.java index 7b91d125..430c199b 100644 --- a/src/org/cacert/gigi/GigiApiException.java +++ b/src/org/cacert/gigi/GigiApiException.java @@ -5,53 +5,55 @@ import java.sql.SQLException; import java.util.LinkedList; public class GigiApiException extends Exception { - SQLException e; - LinkedList messages = new LinkedList<>(); - - public GigiApiException(SQLException e) { - super(e); - this.e = e; - } - - public GigiApiException(String message) { - super(message); - messages.add(message); - } - - public GigiApiException() { - - } - - public void mergeInto(GigiApiException e2) { - messages.addAll(e2.messages); - if (e == null) { - e = e2.e; - } - } - - public boolean isInternalError() { - return e != null; - } - - public void format(PrintWriter out, Language language) { - out.println("
"); - if (isInternalError()) { - e.printStackTrace(); - out.print("
"); - out.println(language.getTranslation("An internal error ouccured.")); - out.println("
"); - } - for (String message : messages) { - out.print("
"); - out.print(language.getTranslation(message)); - out.println("
"); - } - out.println("
"); - - } - - public boolean isEmpty() { - return e == null && messages.size() == 0; - } + + SQLException e; + + LinkedList messages = new LinkedList<>(); + + public GigiApiException(SQLException e) { + super(e); + this.e = e; + } + + public GigiApiException(String message) { + super(message); + messages.add(message); + } + + public GigiApiException() { + + } + + public void mergeInto(GigiApiException e2) { + messages.addAll(e2.messages); + if (e == null) { + e = e2.e; + } + } + + public boolean isInternalError() { + return e != null; + } + + public void format(PrintWriter out, Language language) { + out.println("
"); + if (isInternalError()) { + e.printStackTrace(); + out.print("
"); + out.println(language.getTranslation("An internal error ouccured.")); + out.println("
"); + } + for (String message : messages) { + out.print("
"); + out.print(language.getTranslation(message)); + out.println("
"); + } + out.println("
"); + + } + + public boolean isEmpty() { + return e == null && messages.size() == 0; + } }