Unneeded printStackTrace
See original GitHub issueWe have ZMQ that print a stack trace to stderr. I don’t think a library should be allowed to directly do that. Especialy when the exception is as quite normal java.nio.channels.ClosedByInterruptException
and is thrown during . a plain: zpoller.poll(-1L);
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Why is exception.printStackTrace() considered bad practice?
It may become larger and larger and is filled with useless data because usually you have no context and no timestamp and so...
Read more >Throwable printStackTrace() method in Java with Examples
This method prints a stack trace for this Throwable object on the standard error output stream. The first line of output shows the...
Read more >List of Java inspections | IntelliJ IDEA Documentation - JetBrains
Call to printStackTrace() ... Unnecessary final on local variable or parameter. Disabled. Warning icon Warning. Unnecessary null check before equals() call.
Read more >Deleting a bucket - Amazon Simple Storage Service
If you are unable to delete an Amazon S3 bucket, consider the following: Make sure the bucket is empty – You can only...
Read more >Finding Unused Gradle Dependencies - Baeldung
Learn how to use the Gradle Nebula Lint plugin to identify and fix unused dependencies in your project.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would be more radical:
I did not see occurrences of this stacktrace (and the others of this file, but was not keen to enforce it drastically so I left these traces (several of them are in this file as well).
I agree with you: No stacktrace. If the library handles the situation.
I still see 56 instances of
printStackTrace
in the repo, 18 of which are in the library code (as opposed to in tests, where it might be more feasible to do it).I agree with @fredoboulo about taking a more extreme approach to this. I don’t think there’s any reason why we should print stacktraces to STDERR and then continue running the program. We should handle all exceptions or let them explode.