ApplicationInspector icon indicating copy to clipboard operation
ApplicationInspector copied to clipboard

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

Open gfs opened this issue 2 years ago • 0 comments

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 avatar Jun 22 '22 08:06 gfs