From c1670e75098a1da8c8e5578abe1e611636cbdc8e Mon Sep 17 00:00:00 2001 From: Paul Speed Date: Sat, 2 May 2015 00:39:41 -0400 Subject: [PATCH] Added the read class ID to the bad deserialize exception. Two things can cause bad reads: 1) bad data in the stream... in which the extra info is useless or confusing. 2) unregistered classes or bad timing, either way, knowing the message type ID might be useful. --- .../src/main/java/com/jme3/network/base/MessageProtocol.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jme3-networking/src/main/java/com/jme3/network/base/MessageProtocol.java b/jme3-networking/src/main/java/com/jme3/network/base/MessageProtocol.java index a8d0d39fd..6751ecc3f 100644 --- a/jme3-networking/src/main/java/com/jme3/network/base/MessageProtocol.java +++ b/jme3-networking/src/main/java/com/jme3/network/base/MessageProtocol.java @@ -181,7 +181,7 @@ public class MessageProtocol Message m = (Message)obj; messages.add(m); } catch( IOException e ) { - throw new RuntimeException( "Error deserializing object", e ); + throw new RuntimeException( "Error deserializing object, clas ID:" + buffer.getShort(0), e ); } } }