Improve error reporting in MdsalLowLevelTestProvider 58/78758/1
authorTom Pantelis <tompantelis@gmail.com>
Thu, 13 Dec 2018 15:10:23 +0000 (10:10 -0500)
committerTom Pantelis <tompantelis@gmail.com>
Thu, 13 Dec 2018 15:10:23 +0000 (10:10 -0500)
Change-Id: Icdd86af5601f14d54b54354a1e0a3ffd4dc81653
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/MdsalLowLevelTestProvider.java

index 92bacd1..df314c1 100644 (file)
@@ -537,9 +537,8 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService
         dtclReg = null;
 
         if (!idIntsListener.hasTriggered()) {
-            final RpcError error = RpcResultBuilder.newError(
-                    ErrorType.APPLICATION, "No notification received.", "id-ints listener has not received"
-                            + "any notifications.");
+            final RpcError error = RpcResultBuilder.newError(ErrorType.APPLICATION, "data-missing",
+                    "id-ints listener did not receive any notifications.");
             return Futures.immediateFuture(RpcResultBuilder.<UnsubscribeDtclOutput>failed()
                     .withRpcError(error).build());
         }
@@ -551,7 +550,7 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService
 
             if (!readResult.isPresent()) {
                 final RpcError error = RpcResultBuilder.newError(
-                        ErrorType.APPLICATION, "Final read empty.", "No data read from id-ints list.");
+                        ErrorType.APPLICATION, "data-missing", "No data read from id-ints list.");
                 return Futures.immediateFuture(RpcResultBuilder.<UnsubscribeDtclOutput>failed()
                         .withRpcError(error).build());
             }
@@ -567,7 +566,7 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService
 
         } catch (final InterruptedException | ExecutionException e) {
             final RpcError error = RpcResultBuilder.newError(
-                    ErrorType.APPLICATION, "Read failed.", "Final read from id-ints failed.");
+                    ErrorType.APPLICATION, "operation-failed", "Final read from id-ints failed.", null, null, e);
             return Futures.immediateFuture(RpcResultBuilder.<UnsubscribeDtclOutput>failed()
                     .withRpcError(error).build());
 

©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.