Replace custom Java error message with standard PCEP error message for LSP object... 88/37688/3
authorKevin Wang <kevixw@gmail.com>
Fri, 15 Apr 2016 22:56:25 +0000 (15:56 -0700)
committerMilos Fabian <milfabia@cisco.com>
Fri, 22 Apr 2016 17:14:10 +0000 (17:14 +0000)
Change-Id: I282d26f7e99faca71b58ee20c2098bb4800d27d8
Signed-off-by: Kevin Wang <kevixw@gmail.com>
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/Stateful07TopologySessionListener.java

index 3af316688eaf12fb0a55b48761becd361251b534..bd0ef78a5f694ef04ce7f118fcf9e4231df1248d 100644 (file)
@@ -451,9 +451,10 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
             // Build the request
             final RequestsBuilder rb = new RequestsBuilder();
             final Arguments2 args = this.input.getArguments().getAugmentation(Arguments2.class);
-            Preconditions.checkArgument(args != null, "Input is missing operational tag.");
-            final Lsp inputLsp = args.getLsp();
-            Preconditions.checkArgument(inputLsp != null, "Reported LSP does not contain LSP object.");
+            final Lsp inputLsp = (args != null) ? args.getLsp() : null;
+            if (inputLsp == null) {
+                return OperationResults.createUnsent(PCEPErrors.LSP_MISSING).future();
+            }
 
             rb.fieldsFrom(this.input.getArguments());