]> source.dussan.org Git - vaadin-framework.git/commitdiff
Handle all 4xx error codes like 404 (show error message). For #4380.
authorArtur Signell <artur.signell@itmill.com>
Fri, 9 Apr 2010 09:09:20 +0000 (09:09 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 9 Apr 2010 09:09:20 +0000 (09:09 +0000)
Added missing endRequests so the progress indicator will disappear also if there is an error.

svn changeset:12422/svn branch:6.3

src/com/vaadin/terminal/gwt/client/ApplicationConnection.java

index 8574bc0476827559b25450d8badb7496dc551c96..5b1e9ccaacbbcd0a2b595779c8f80ae7b98efefe 100755 (executable)
@@ -409,12 +409,18 @@ public class ApplicationConnection {
                                         - requestStartTime.getTime()) + "ms");
 
                         int statusCode = response.getStatusCode();
+                        if ((statusCode / 100) == 4) {
+                            // Handle all 4xx errors the same way as (they are
+                            // all permanent errors)
+                            showCommunicationError("UIDL could not be read from server. Check servlets mappings. Error code: "
+                                    + statusCode);
+                            endRequest();
+                            return;
+                        }
                         switch (statusCode) {
                         case 0:
                             showCommunicationError("Invalid status code 0 (server down?)");
-                            return;
-                        case 404:
-                            showCommunicationError("UIDL could not be read from server. Check servlets mappings.");
+                            endRequest();
                             return;
                         case 503:
                             // We'll assume msec instead of the usual seconds
@@ -429,6 +435,7 @@ public class ApplicationConnection {
                                             forceSync, analyzeLayouts);
                                 }
                             }).schedule(delay);
+                            endRequest();
                             return;
 
                         }