Make sure we know the version we encountered 12/84512/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 18 Sep 2019 00:11:23 +0000 (02:11 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 18 Sep 2019 00:11:23 +0000 (02:11 +0200)
Hitting this exception is not providing sufficent detail as to
what the proposed version is. Add that information.

Change-Id: I44662e904774b636b351beb4c6b1f218e84f8ada
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/VersionedExternalizableMessage.java

index c809029..622485b 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;

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.