From: Artur Signell Date: Fri, 9 Apr 2010 09:09:20 +0000 (+0000) Subject: Handle all 4xx error codes like 404 (show error message). For #4380. X-Git-Tag: 6.7.0.beta1~1762 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a36ffa5d26ac8e9e2bd81015fdd0daa8d45c6f4a;p=vaadin-framework.git Handle all 4xx error codes like 404 (show error message). For #4380. Added missing endRequests so the progress indicator will disappear also if there is an error. svn changeset:12422/svn branch:6.3 --- diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 8574bc0476..5b1e9ccaac 100755 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -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; }