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

[Trivial] Add error logs on unmarshal errors #242

Merged
merged 2 commits into from
Nov 25, 2022

Conversation

jotak
Copy link
Member

@jotak jotak commented Nov 24, 2022

No description provided.

@openshift-ci
Copy link

openshift-ci bot commented Nov 24, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from jotak by writing /assign @jotak in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -115,6 +116,7 @@ func fetchSingle(lokiClient httpclient.Caller, flowsURL string, merger loki.Merg
}
var qr model.QueryResponse
if err := json.Unmarshal(resp, &qr); err != nil {
hlog.Errorf("Cannot unmarshal (%v). Response was: %s", err, string(resp))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another form is hlog.WithError(err).Errorf("cannot unmarshal %v", string(resp)) but yours it's also fine.

Copy link
Collaborator

@OlivierCazade OlivierCazade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci openshift-ci bot removed the lgtm label Nov 25, 2022
@openshift-ci
Copy link

openshift-ci bot commented Nov 25, 2022

New changes are detected. LGTM label has been removed.

@jotak jotak merged commit a01be99 into netobserv:main Nov 25, 2022
@jotak jotak deleted the log-unmarshal branch November 7, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants