Make sure we know the version we encountered
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / VersionedExternalizableMessage.java
index c809029a0fbe9c74e4fcd302eaf8e809cf009cd2..622485b09ea58dce6e11c6dd1f78d49a62592106 100644 (file)
@@ -53,9 +53,10 @@ public abstract class VersionedExternalizableMessage implements Externalizable,
 
     @Override
     public final Object toSerializable() {
-        if (getVersion() < DataStoreVersions.BORON_VERSION) {
-            throw new UnsupportedOperationException("Versions prior to " + DataStoreVersions.BORON_VERSION
-                    + " are not supported");
+        final short ver = getVersion();
+        if (ver < DataStoreVersions.BORON_VERSION) {
+            throw new UnsupportedOperationException("Version " + ver
+                + " is older than the oldest version supported version " + DataStoreVersions.BORON_VERSION);
         }
 
         return this;