Skip to content

Commit

Permalink
catch deconding exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ajuvercr committed Nov 9, 2019
1 parent 1e11dc6 commit 6ba792f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/telraam/beacon/Beacon.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ public void run() {
msgBuf.remove(msgBuf.size() - 1);
}

this.data(new BeaconMessage(msgBuf));
// Catch errors thrown at message decoding and propagate
try {
this.data(new BeaconMessage(msgBuf));
} catch (Exception e) {
this.error(e);
}

readingMsg = false;
} else {
this.error(new BeaconException.MsgEndWithNoStart());
Expand Down

0 comments on commit 6ba792f

Please sign in to comment.