Skip to content
Snippets Groups Projects
Commit 1e36c405 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Catch JSONClient() errors here and report (throw) them up.

parent 217dc798
No related branches found
No related tags found
No related merge requests found
......@@ -14,10 +14,14 @@ load(root + "diceobj.js");
var game_id = "dicewarz2";
var timer = new Timer();
var client = new JSONClient(serverAddr,serverPort);
var settings = loadSettings("dice.ini");
var ai = loadAI("ai.ini");
var aiTakingTurns = {};
try {
var client = new JSONClient(serverAddr,serverPort);
var settings = loadSettings("dice.ini");
var ai = loadAI("ai.ini");
var aiTakingTurns = {};
} catch(e) {
throw new Error(e);
}
var data = {
games:client.read(game_id,"games",1),
......@@ -329,4 +333,4 @@ close();
} catch(e) {
log(LOG_ERROR,e.toSource());
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment