Yi EungJun 2015-04-03
Fix server error occured when get an attachment
An OptimisticLockException occured occasionally while updating
user's preferred language.

Just ignore the exception because the failure is not critical.
@80c653a601175db2a022a03d79c9f5bdfeefc371
app/Global.java
--- app/Global.java
+++ app/Global.java
@@ -180,7 +180,11 @@
         return new Action.Simple() {
             public Promise<Result> call(Http.Context ctx) throws Throwable {
                 UserApp.initTokenUser();
-                UserApp.updatePreferredLanguage();
+                try {
+                    UserApp.updatePreferredLanguage();
+                } catch (Exception e) {
+                    play.Logger.warn("Failed to update the preferred language", e);
+                }
                 ctx.response().setHeader("Date", DateUtils.formatDate(new Date()));
                 ctx.response().setHeader("Cache-Control", "no-cache");
                 Promise<Result> promise = delegate.call(ctx);
Add a comment
List