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

Remove exceptions printing stack traces #1290

Closed
JPercival opened this issue Nov 23, 2023 · 1 comment · Fixed by #1291
Closed

Remove exceptions printing stack traces #1290

JPercival opened this issue Nov 23, 2023 · 1 comment · Fixed by #1291
Labels

Comments

@JPercival
Copy link
Contributor

At various places in the CQL libraries Exceptions are caught and stack traces are printed such as here:

https://github.com/cqframework/clinical_quality_language/blob/master/Src/java/quick/src/main/java/org/cqframework/cql/cql2elm/quick/FhirModelInfoProvider.java#L69

For a core library included in other components, this bypasses whatever other logging mechanisms may be in place (such as slf4j, log4j, etc) and prints directly to the std error output stream. This means some diagnostic logging may be lost, and it also pollutes the output stream in cases where that's not desirable. For example, with the use of CLI tools.

We should remove all instances of Exception::printStackTrace() and either rethrow exceptions, log via a logging API, or ignore as appropriately.

The one exception to that rule is in the case where we're intentionally building a CLI.

@JPercival JPercival added the bug label Nov 23, 2023
@JPercival
Copy link
Contributor Author

second exception to the rule: Test code. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant