-
Notifications
You must be signed in to change notification settings - Fork 10
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
Wrap errors from newest to oldest #105
Comments
After some investigation regarding the linter, the |
We could also write a step using bash in the linter GitHub Action which fetches any values that don't match the pattern with err at the end, something like |
* Resolve conflict * Added error wrapping changes ##105 * Fix unit testing and wrapped errors #105 * Fix e2e testing * Fix e2e testing * remove assertion duplication as require.errorAs is included in the require.errorIs * resolve error messages * changes for the PR comment * changes for the PR comment * patch the path error message * patch the path error message * e2e cleanup err msg * reformat the error message * reformat the error message * reformat the error message * reformat the error message
Description
Sometimes we wrap errors like
<older>: <newer>
, e.g., in: https://github.com/kyma-project/modulectl/blob/main/internal/service/create/create.go#L222We should rather wrap them in the different order
<newer>: <older>
Also take care of reformulating err message then if the order changes to make more sense.
Reasons
See Google Style guide Placement of %w in errors. It is good practice to wrap like
<newer>: <older>
so that the printed error reads from newer to older (i.e., generic to specific) and so that the print is aligned with the unwrapping of the error.AC
Attachments
The text was updated successfully, but these errors were encountered: