Skip to content

Commit

Permalink
Make error message easier (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanG100 authored Apr 26, 2023
1 parent 87b71a8 commit 87c93e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ygnmi/gnmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (gs *getSubscriber) Send(req *gpb.SubscribeRequest) error {
if st, ok := status.FromError(err); ok && st.Code() == codes.NotFound { // Make this behave like Subscribe, where non-existent paths don't return values.
return nil
} else if err != nil {
return err
return fmt.Errorf("gNMI.Get request failed: %w", err)
}
gs.notifs = resp.GetNotification()
return nil
Expand Down
2 changes: 1 addition & 1 deletion ygnmi/ygnmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@ func LookupAll[T any](ctx context.Context, c *Client, q WildcardQuery[T], opts .
return nil, fmt.Errorf("failed to unmarshal data: %w", err)
}
if v.ComplianceErrors != nil {
log.V(0).Infof("noncompliant data encountered while unmarshalling: %v", v.ComplianceErrors)
if q.isLeaf() {
continue
}
log.V(0).Infof("noncompliant data encountered while unmarshalling: %v", v.ComplianceErrors)
}
vals = append(vals, v)
}
Expand Down

0 comments on commit 87c93e3

Please sign in to comment.