From 4c30c1a6e0db052ac8151408707d0c7adfc380d4 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Sat, 18 May 2013 14:42:50 -0300 Subject: [PATCH] make http round actions recover from failures --- app/controllers/Round.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/Round.scala b/app/controllers/Round.scala index 3103268a02..aa5bdd35e6 100644 --- a/app/controllers/Round.scala +++ b/app/controllers/Round.scala @@ -124,14 +124,16 @@ object Round extends LilaController with TheftPrevention { protected def performAndRedirect(fullId: String, makeMessage: String ⇒ Any) = Action { Async { - perform(fullId, makeMessage) inject Redirect(routes.Round.player(fullId)) + perform(fullId, makeMessage) recover { + case e: Exception ⇒ logwarn("[round] perform " + e.getMessage) + } inject Redirect(routes.Round.player(fullId)) } } protected def perform(fullId: String, makeMessage: String ⇒ Any): Funit = { Env.round.roundMap ! Tell( GameModel takeGameId fullId, - makeMessage(GameModel takePlayerId(fullId)) + makeMessage(GameModel takePlayerId (fullId)) ) Env.round.roundMap ? Await(GameModel takeGameId fullId) void }