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

Improve the logging output when hitting an expected error creating Analyze Command #464

Closed
gfs opened this issue Jun 22, 2022 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@gfs
Copy link
Contributor

gfs commented Jun 22, 2022

When creating an analyze command the "ConfigSourceToScan" and "ConfigRules" methods are called from the constructor. These methods may throw exceptions, and those exceptions are printed to the console with the stack trace. This level of detail isn't needed (perhaps the stack trace should show up on the debug level) but the Error level should be less verbose and a human readable error message. This ctor is called in many places (IDE is indicating over 50), so its a medium effort to refactor all those calls to handle the exception more gracefully.

Alternately consider a different calling pattern that obviates the need for throwing these exceptions in the first place.

For example, we currently throw an exception from the AnalyzeCommand if the source to scan contains no files. This seems like a worthwhile check, but likely doesn't need to be in the analyze command, and probably should just be part of the CLI experience not the lib.

@gfs gfs added the enhancement New feature or request label Jun 22, 2022
@gfs gfs added the good first issue Good for newcomers label Nov 16, 2022
@gfs
Copy link
Contributor Author

gfs commented Feb 16, 2023

These methods were cleaned up in #513.

@gfs gfs closed this as completed Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant