-
Notifications
You must be signed in to change notification settings - Fork 38
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
cli: Don't print help and don't skip defer
ed funcs on failures
#2942
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2942 +/- ##
==========================================
- Coverage 23.88% 23.53% -0.35%
==========================================
Files 776 776
Lines 45893 46565 +672
==========================================
- Hits 10961 10960 -1
- Misses 34070 34743 +673
Partials 862 862 ☔ View full report in Codecov by Sentry. |
85bf87d
to
24ab511
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.
Conflicts, rebase pls. But looks nice in general. Probably we can add some tests for it as well.
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.
b99e708
to
23c2dce
Compare
Now, in the |
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 suggest to ref first 3 commits to #2890 #2942 (review)
For all cobra-based programs add custom error with code and cause of error and exit func from programs. Refs #2890. Signed-off-by: Andrey Butusov <[email protected]>
Use `RunE` instead of `Run` and throw an error to main function. Then handle error with custom error handler. Refs #2890. Signed-off-by: Andrey Butusov <[email protected]>
23c2dce
to
0162cb0
Compare
Use `RunE` instead of `Run` and throw an error to main function. Wrap error with `common.WrapError` to specify the status code. Then handle error with custom error handler. Refs #2890. Signed-off-by: Andrey Butusov <[email protected]>
Use `RunE` instead of `Run` and throw an error to main function. Then handle error with custom error handler. Update CHANGELOG.md. Closes #2890. Signed-off-by: Andrey Butusov <[email protected]>
Closes #623. Refs #2890. Signed-off-by: Andrey Butusov <[email protected]>
0162cb0
to
fc291a2
Compare
From #2942, error format in `adm` is broken. All errors need to be wrapped up: `fmt.Errorf("Error: %w\n", err)`. Signed-off-by: Andrey Butusov <[email protected]>
Closes #623, #2890.
In
neofs-cli
I add funccommon.WrapError
that wrap error tocustom_errors.ExitErr
and return it on every error, But I doubt it. Maybe it is necessary to wrap only the first appearance of this error, or vice versa, only the last one.