keploy
keploy copied to clipboard
fix: ensured error logs not shown incase of an unknown command
Related Issue
- Incase of unknown command the logger should not be logging.
Closes: #1328
Describe the changes you've made
- extracting the error for the errorString we can ensure no logging
Results
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Code style update (formatting, local variables)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
Please let us know if any test cases are added
Please describe the tests(if any). Provide instructions how its affecting the coverage.
Describe if there is any unusual behaviour of your code(Write NA if there isn't)
A clear and concise description of it.
Checklist:
- [x] My code follows the style guidelines of this project.
- [x] I have performed a self-review of my own code.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have made corresponding changes to the documentation.
- [x] My changes generate no new warnings.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] New and existing unit tests pass locally with my changes.
Screenshots (if any)
| Original | Updated |
|---|---|
| original screenshot | updated screenshot |
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
@PranshuSrivastava incase of unknown shorthand we see a similar log do let me know and please review at your convenience. Thanks!!
@varun7singh yes this looks like a good approach to go about it.
@PranshuSrivastava i've added for both flags and commands but note in some cmds like record.go and test.go we have
recordCmd.SilenceUsage = true
recordCmd.SilenceErrors = true
which does not allow the cobra error and the usage to print do let me know if we need them Thanks !!
@PranshuSrivastava could you review this please Thanks!
@varun7singh Please update your branch according to the refactored changes.
@gouravkrosx the error seems to be resolved in later updates i'll close this pr
closing the PR as issue solved in later updatesr