VOL-2401 - turn error into warning
Change-Id: Ic7661bf6a9bda5d8468efe2124f7bcdc142be04a
diff --git a/rw_core/core/adapter_request_handler.go b/rw_core/core/adapter_request_handler.go
index dbdcc31..fd07c7e 100644
--- a/rw_core/core/adapter_request_handler.go
+++ b/rw_core/core/adapter_request_handler.go
@@ -778,10 +778,13 @@
}
go func() {
- err := rhp.deviceMgr.updatePortState(context.TODO(), deviceID.Id, voltha.Port_PortType(portType.Val), uint32(portNo.Val),
- voltha.OperStatus_Types(operStatus.Val))
- if err != nil {
- log.Errorw("unable-to-update-port-state", log.Fields{"error": err})
+ if err := rhp.deviceMgr.updatePortState(context.TODO(), deviceID.Id, voltha.Port_PortType(portType.Val), uint32(portNo.Val),
+ voltha.OperStatus_Types(operStatus.Val)); err != nil {
+ // If the error doesn't change behavior and is
+ // essentially ignored, it is not an error, it is a
+ // warning.
+ // TODO: VOL-2707
+ log.Warnw("unable-to-update-port-state", log.Fields{"error": err})
}
}()
diff --git a/rw_core/core/device_manager.go b/rw_core/core/device_manager.go
index fab90ee..714c535 100755
--- a/rw_core/core/device_manager.go
+++ b/rw_core/core/device_manager.go
@@ -882,7 +882,13 @@
go func() {
err := dMgr.logicalDeviceMgr.updatePortState(context.Background(), deviceID, portNo, operStatus)
if err != nil {
- log.Errorw("unable-to-update-port-state", log.Fields{"error": err})
+ // While we want to handle (catch) and log when
+ // an update to a port was not able to be
+ // propagated to the logical port, we can report
+ // it as a warning and not an error because it
+ // doesn't stop or modify processing.
+ // TODO: VOL-2707
+ log.Warnw("unable-to-update-logical-port-state", log.Fields{"error": err})
}
}()
}