-
Type: Task
-
Status: To Do (View Workflow)
-
Priority: Medium
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: VOLTHA v2.12
-
Component/s: ofagent-go, openolt-adapter, openonu-adapter, rw-core
-
Labels:None
-
Story Points:3
Currently we have code similar to the following sprinkled throughout the project
return errors.New("foo-not-found")
or
return fmt.Errorf("some error: %s", err)
This really should be cleaned up so that we define some common errors that are used throughout the code, i.e
var ErrNotFound = errors.New("not-found")
as well as we should start using error wrapping
return fmt.Errorf("some context: %w")
errors.Is()
with respect to common errors, there is an assumption that a common "not-found" is just as good as a specific "foo-not-found" as the code that logs the error should (a) be determining what needs to be logged and (b) the unwrapping should give the appropriate context.