Skip to content

Commit 7abc54c

Browse files
committed
Set variable if parse exception occurs
1 parent ed42b45 commit 7abc54c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/com/erikpaluka/multileap/input/LeapParser.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class LeapParser {
3131
JSONParser jParser;
3232
final int ID_ADDITION = 10_000_000;
3333
public ControllerObj controller;
34-
34+
public boolean exceptionOccurred = false;
3535

3636
public LeapParser() {
3737
jParser = new JSONParser();
@@ -43,7 +43,8 @@ public FrameObj parse(String msg, ControllerObj controller) {
4343
this.controller = controller;
4444

4545
try {
46-
JSONAdapter jAdapter = new JSONAdapter(jParser.parse(msg));
46+
Object parsedMsg = jParser.parse(msg);
47+
JSONAdapter jAdapter = new JSONAdapter(parsedMsg);
4748

4849
if (jAdapter.containsKey("currentFrameRate")) {
4950

@@ -78,8 +79,9 @@ public FrameObj parse(String msg, ControllerObj controller) {
7879
return frame;
7980
}
8081
} catch (ParseException e) {
82+
exceptionOccurred = true;
8183
System.out.println("ParseException for LeapVM message.");
82-
e.printStackTrace();
84+
//e.printStackTrace();
8385
}
8486

8587
return null;

0 commit comments

Comments
 (0)