From 828765d840415eddf199f7398111520dc10feae7 Mon Sep 17 00:00:00 2001 From: gnieark Date: Thu, 17 Dec 2015 22:28:51 +0100 Subject: [PATCH] js reduce try catch --- src/arenas/Battleship/js.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/arenas/Battleship/js.js b/src/arenas/Battleship/js.js index 2c41adf..4b27839 100644 --- a/src/arenas/Battleship/js.js +++ b/src/arenas/Battleship/js.js @@ -87,7 +87,7 @@ function battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShi //alert(xhr.responseText); try{ var grids = JSON.parse(xhr.responseText); - catch(e){ + }catch(e){ document.getElementById('logs').innerHTML = xhr.responseText; return; } @@ -108,7 +108,6 @@ function battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShi } - } }}; xhr.open("POST", '/Battleship', true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");