Merge "Pass error cause to service status"
authorAnil Vishnoi <vishnoianil@gmail.com>
Mon, 4 Jun 2018 16:16:56 +0000 (16:16 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 4 Jun 2018 16:16:56 +0000 (16:16 +0000)
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/diagstatus/OpenflowPluginDiagStatusProvider.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java

index ab8f904616614609be04bb15a832db81ec6ed177..0c2ea7c9fdc67c354a93b834018fb4cd84868417 100644 (file)
@@ -47,6 +47,11 @@ public class OpenflowPluginDiagStatusProvider implements ServiceStatusProvider {
         });
     }
 
+    public void reportStatus(ServiceState serviceState, Throwable throwable) {
+        LOG.debug("reporting status as {} for {}", serviceState, OPENFLOW_SERVICE_NAME);
+        diagStatusService.report(new ServiceDescriptor(OPENFLOW_SERVICE_NAME, throwable));
+    }
+
     public void reportStatus(ServiceState serviceState, String description) {
         LOG.debug("reporting status as {} for {}", serviceState, OPENFLOW_SERVICE_NAME);
         diagStatusService.report(new ServiceDescriptor(OPENFLOW_SERVICE_NAME, serviceState, description));
index d40137d98f1c1b9baa1d1929ee9f499c6b30fbef..164f0f18cd1cc61cdeed2b2d77d65fa37fd6e448 100644 (file)
@@ -178,7 +178,7 @@ public class OpenFlowPluginProviderImpl implements
             @Override
             public void onFailure(@Nonnull final Throwable throwable) {
                 LOG.warn("Some switchConnectionProviders failed to start.", throwable);
-                openflowPluginStatusMonitor.reportStatus(ServiceState.ERROR, "some switch connections failed to start");
+                openflowPluginStatusMonitor.reportStatus(ServiceState.ERROR, throwable);
             }
         }, MoreExecutors.directExecutor());
     }