[VOL-2415] Enable with invalid device-id should throw NotFound error
Change-Id: Ifb3b188b8fe31563326485cdbf59a92c0029e1b1
diff --git a/rw_core/core/device_manager.go b/rw_core/core/device_manager.go
index 7365503..4dff5a6 100755
--- a/rw_core/core/device_manager.go
+++ b/rw_core/core/device_manager.go
@@ -189,6 +189,8 @@
if agent := dMgr.getDeviceAgent(id.Id); agent != nil {
res = agent.enableDevice(ctx)
log.Debugw("EnableDevice-result", log.Fields{"result": res})
+ } else {
+ res = status.Errorf(codes.NotFound, "%s", id.Id)
}
sendResponse(ctx, ch, res)