Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make error message better #91

Merged
merged 1 commit into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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