# HG changeset patch # User Christian Lins # Date 1347184999 0 # Node ID 8e69aca69074582be81b8891a3ef5423d8fd9aff # Parent 2e12518ff5b440d74e3b30a8fcdbeb083c7acc8d Catch MissingResourceException on unexpected server exceptions. flys-client/trunk@5408 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 2e12518ff5b4 -r 8e69aca69074 flys-client/ChangeLog --- a/flys-client/ChangeLog Sat Sep 08 12:22:53 2012 +0000 +++ b/flys-client/ChangeLog Sun Sep 09 10:03:19 2012 +0000 @@ -1,3 +1,11 @@ +2012-09-09 Christian Lins + + * src/main/java/de/intevation/flys/client/server/UserServiceImpl.java: + Remove blank line. + + * src/main/java/de/intevation/flys/client/client/FLYS.java: + Catch MissingResourceException on unexpected server exceptions (#843). + 2012-09-08 Sascha L. Teichmann * src/main/java/de/intevation/flys/client/server/auth/plain/Authenticator.java: diff -r 2e12518ff5b4 -r 8e69aca69074 flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Sat Sep 08 12:22:53 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Sun Sep 09 10:03:19 2012 +0000 @@ -40,6 +40,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.MissingResourceException; import java.util.Set; @@ -137,13 +138,22 @@ Config config = Config.getInstance(); String locale = config.getLocale(); - getRivers(); // Useless call? - userService.getCurrentUser(locale, new AsyncCallback() { @Override public void onFailure(Throwable caught) { GWT.log("Could not find a logged in user."); - SC.warn(MSG.getString(caught.getMessage())); + String msg = caught.getLocalizedMessage(); + try { + msg = MSG.getString(caught.getMessage()); + } + catch(MissingResourceException ex) { + // There are some server error exceptions with + // varying text messages that cannot be localized + // easily. In this rare cases, use the plain + // exception message. + GWT.log("Missing resource for: " + caught.getMessage()); + } + SC.warn(msg); } @Override diff -r 2e12518ff5b4 -r 8e69aca69074 flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java Sat Sep 08 12:22:53 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java Sun Sep 09 10:03:19 2012 +0000 @@ -23,7 +23,6 @@ { private static final Logger logger = Logger.getLogger(UserServiceImpl.class); - public static final String ERROR_NO_SUCH_USER = "error_no_such_user"; public User getCurrentUser(String locale)