aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/WatchFrameDecoder.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/WatchFrameDecoder.java b/src/org/traccar/protocol/WatchFrameDecoder.java
index b2ac5b4f7..b4a82c0be 100644
--- a/src/org/traccar/protocol/WatchFrameDecoder.java
+++ b/src/org/traccar/protocol/WatchFrameDecoder.java
@@ -33,7 +33,8 @@ public class WatchFrameDecoder extends BaseFrameDecoder {
while (buf.readerIndex() < endIndex) {
byte b = buf.readByte();
if (b == '}') {
- switch (buf.readByte()) {
+ byte c = buf.readByte();
+ switch (c) {
case 0x01:
frame.writeByte('}');
break;
@@ -50,7 +51,8 @@ public class WatchFrameDecoder extends BaseFrameDecoder {
frame.writeByte('*');
break;
default:
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException(String.format(
+ "unexpected byte at %d: 0x%02x", buf.readerIndex() - 1, c));
}
} else {
frame.writeByte(b);