multi: fix fmt.Errorf error wrapping
Refactor fmt.Errorf usage to correctly wrap errors instead of using non-wrapping format verbs.
This commit is contained in:
103 files changed
+426
-390
No files matched your search
@@ -245,7 +245,7 @@ func (nw *nodeWatcher) WaitForChannelPolicyUpdate(
|
||||
case <-timer:
|
||||
expected, err := json.MarshalIndent(policy, "", "\t")
|
||||
if err != nil {
|
||||
return fmt.Errorf("encode policy err: %v", err)
|
||||
return fmt.Errorf("encode policy err: %w", err)
|
||||
}
|
||||
policies, err := syncMapToJSON(
|
||||
&nw.state.policyUpdates.Map,
|
||||
@@ -274,7 +274,7 @@ func syncMapToJSON(state *sync.Map) ([]byte, error) {
|
||||
})
|
||||
policies, err := json.MarshalIndent(m, "", "\t")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("encode polices err: %v", err)
|
||||
return nil, fmt.Errorf("encode polices err: %w", err)
|
||||
}
|
||||
|
||||
return policies, nil
|
||||
|
||||
Reference in new issue
Block a user