[VOL-5451] delete device error handling
Signed-off-by: mgouda <madhumati.gouda@radisys.com>
Change-Id: I95e83b560d01f266901ba1bc1f1ea59ca55a8cd5
Signed-off-by: mgouda <madhumati.gouda@radisys.com>
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 3d12954..fc5efef 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -2239,8 +2239,9 @@
// and deleteDevice is issued , returning error will further prevent clean up
// at rwcore . Returning success for clean up to happen and discovery to happen again.
if pDevEntry == nil {
- logger.Errorw(ctx, "No valid OnuDevice -aborting", log.Fields{"device-id": dh.DeviceID})
- return nil
+ errMsg := fmt.Sprintf("Device entry is not found %s", dh.DeviceID)
+ logger.Error(ctx, errMsg)
+ return status.Error(codes.NotFound, errMsg)
}
if pDevEntry.PDevOmciCC != nil {
pDevEntry.PDevOmciCC.CancelRequestMonitoring(ctx)