VOL-1774 Etcd Crash Handling
Change-Id: I1eeb726654c3972fd0a4fafae134607e5a810415
diff --git a/ro_core/core/grpc_nbi_api_handler.go b/ro_core/core/grpc_nbi_api_handler.go
index a611337..0a73ff2 100644
--- a/ro_core/core/grpc_nbi_api_handler.go
+++ b/ro_core/core/grpc_nbi_api_handler.go
@@ -153,7 +153,12 @@
// ListDevices returns the contents of all devices known to the system
func (handler *APIHandler) ListDevices(ctx context.Context, empty *empty.Empty) (*voltha.Devices, error) {
log.Debug("ListDevices")
- return handler.deviceMgr.ListDevices()
+ devices, err := handler.deviceMgr.ListDevices()
+ if err != nil {
+ log.Errorw("failed-to-list-devices", log.Fields{"error": err})
+ return nil, err
+ }
+ return devices, nil
}
// ListDeviceIds returns the list of device ids managed by a voltha core