Changed service keepAlive from POST to PUT
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / clients / A1ClientFactory.java
index 55abe2c..546979c 100644 (file)
@@ -86,7 +86,7 @@ public class A1ClientFactory {
     private ControllerConfig getControllerConfig(Ric ric) throws ServiceException {
         String controllerName = ric.getConfig().controllerName();
         if (controllerName.isEmpty()) {
-            throw new ServiceException("NO controller configured for RIC: " + ric.name());
+            throw new ServiceException("No controller configured for RIC: " + ric.name());
         }
         return this.appConfig.getControllerConfig(controllerName);
     }
@@ -114,7 +114,9 @@ public class A1ClientFactory {
                 .onErrorResume(notUsed -> fetchVersion(ric, A1ProtocolType.SDNC_ONAP)) //
                 .doOnNext(ric::setProtocolVersion)
                 .doOnNext(version -> logger.debug("Established protocol version:{} for Ric: {}", version, ric.name())) //
-                .doOnError(notUsed -> logger.warn("Could not get protocol version from RIC: {}", ric.name())); //
+                .doOnError(notUsed -> logger.warn("Could not get protocol version from RIC: {}", ric.name())) //
+                .onErrorResume(
+                    notUsed -> Mono.error(new ServiceException("Protocol negotiation failed for " + ric.name())));
         } else {
             return Mono.just(ric.getProtocolVersion());
         }