Bug 1003: Restconf - remove whitespace on input
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / sal / dom / broker / impl / SchemaAwareRpcBroker.java
index 3e7b115f11e28667114c798062bd4737cda9f333..a2c43d0c73ba402f13bd7b604a9629b617637732 100644 (file)
@@ -174,8 +174,12 @@ public class SchemaAwareRpcBroker implements RpcRouter, Identifiable<String>, Ro
         if (potentialImpl != null) {
             return potentialImpl;
         }
+
         potentialImpl = defaultImplementation;
-        checkState(potentialImpl != null, "Implementation is not available.");
+        if( potentialImpl == null ) {
+            throw new UnsupportedOperationException( "No implementation for this operation is available." );
+        }
+
         return potentialImpl;
     }
 
@@ -326,7 +330,8 @@ public class SchemaAwareRpcBroker implements RpcRouter, Identifiable<String>, Ro
             SimpleNode<?> routeContainer = inputContainer.getFirstSimpleByName(strategy.getLeaf());
             checkArgument(routeContainer != null, "Leaf %s must be set with value", strategy.getLeaf());
             Object route = routeContainer.getValue();
-            checkArgument(route instanceof InstanceIdentifier);
+            checkArgument(route instanceof InstanceIdentifier,
+                          "The routed node %s is not an instance identifier", route);
             RpcImplementation potential = null;
             if (route != null) {
                 RoutedRpcRegImpl potentialReg = implementations.get(route);
@@ -457,7 +462,7 @@ public class SchemaAwareRpcBroker implements RpcRouter, Identifiable<String>, Ro
         try {
         listener.onRouteChange(initial);
         } catch (Exception e) {
-            LOG.error("Unhandled exception during sending initial route change event {} to {}",initial,listener);
+            LOG.error("Unhandled exception during sending initial route change event {} to {}",initial,listener, e);
         }
         return reg;
     }