-
Notifications
You must be signed in to change notification settings - Fork 107
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
osbuild-worker: rework the workerClientErrorFrom()
error
#4254
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added one comment, but the PR technically LGTM. 👍
86f4503
to
36fac07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks 👍
36fac07
to
43908d5
Compare
2d97926
to
45003b8
Compare
The workerClientErrorFrom() was returning an `*clienterrors.Error` and an `error` (if something with the conversation goes wrong. But the calling code was expecting that even if an `error` is returned the `*clienterrors.Error` is still valid. The caller would then just log the error. As returning a valid `value` even when there is an `error` is an unexpected pattern this commit changes the code to always return a `*clienterrors.Error` and log any issue via the logger.
45003b8
to
96633ff
Compare
Sorry, had to rebase because of conflicts, could you please re-review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looks good.
I realized that we should eventually replace dnf-json
in the error strings with osbuild-depsolve-dnf
...
The workerClientErrorFrom() was returning an
*clienterrors.Error
and anerror
(if something with the conversation goes wrong.But the calling code was expecting that even if an
error
is returned the*clienterrors.Error
is still valid. The caller would then just log the error. As returning a validvalue
even when there is anerror
is an unexpected pattern this commit changes the code to always return a*clienterrors.Error
and log any issue via the logger.