fix: make errors real bootstrap-alerts
authorFelix Dörre <felix@dogcraft.de>
Sun, 10 Jul 2016 22:03:15 +0000 (00:03 +0200)
committerFelix Dörre <felix@dogcraft.de>
Sun, 10 Jul 2016 22:19:51 +0000 (00:19 +0200)
Change-Id: Icae63c5af5b5c08eb681a867f2bb51785957f2a9

src/org/cacert/gigi/GigiApiException.java
tests/org/cacert/gigi/testUtils/ManagedTest.java

index a61b4b5c68cc431445fa192f0f9d842d0e791ab4..7b3a990938ad0df650ec2b9c5079124f6d7286ee 100644 (file)
@@ -51,7 +51,7 @@ public class GigiApiException extends Exception {
     }
 
     public void format(PrintWriter out, Language language) {
-        out.println("<div class='bg-danger error-msgs'>");
+        out.println("<div class='alert alert-danger error-msgs'>");
         if (isInternalError()) {
             e.printStackTrace();
             out.print("<p>");
index 17dcc5c9621e616a429b4a6175aaf0d9259e0bef..f3c0044bfa4213901ac4dbd241a8331ed06c4a57 100644 (file)
@@ -268,7 +268,7 @@ public class ManagedTest extends ConfiguredTest {
     }
 
     public static org.hamcrest.Matcher<String> hasError() {
-        return CoreMatchers.containsString("<div class='bg-danger error-msgs'>");
+        return CoreMatchers.containsString("<div class='alert alert-danger error-msgs'>");
     }
 
     public static org.hamcrest.Matcher<String> hasNoError() {
@@ -276,12 +276,12 @@ public class ManagedTest extends ConfiguredTest {
     }
 
     public static String fetchStartErrorMessage(String d) throws IOException {
-        String formFail = "<div class='bg-danger error-msgs'>";
+        String formFail = "<div class='alert alert-danger error-msgs'>";
         int idx = d.indexOf(formFail);
         if (idx == -1) {
             return null;
         }
-        String startError = d.substring(idx + formFail.length(), idx + 100).trim();
+        String startError = d.substring(idx + formFail.length(), idx + formFail.length() + 150).trim();
         return startError;
     }