Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Fix server error occured when get an attachment
Browse files Browse the repository at this point in the history
An OptimisticLockException occured occasionally while updating
user's preferred language.

Just ignore the exception because the failure is not critical.
  • Loading branch information
Yi EungJun committed Apr 3, 2015
1 parent a3bb610 commit 80c653a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ private Action<Void> getDefaultAction(final Http.Request request) {
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);
Expand Down

0 comments on commit 80c653a

Please sign in to comment.