Replace printStackTrace with proper error propagation#52
Open
Replace printStackTrace with proper error propagation#52
Conversation
JunitReportReader now wraps XMLStreamException in RuntimeException instead of printing stack traces, since Iterator.next() cannot declare checked exceptions. MavenPlugin now throws MojoExecutionException instead of swallowing 6 exception types, so Maven correctly reports BUILD FAILURE on errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
e.printStackTrace()inJunitReportReader(2 occurrences) withthrow new RuntimeException(message, e)— errors now propagate to callers instead of being silently swallowede.printStackTrace()catch blocks inMavenPlugin.execute()with a single multi-catch that throwsMojoExecutionException— Maven now reports BUILD FAILURE on errorsContext
All 8
printStackTrace()calls in production code have been present since the initial commit (c71ed1f, 2021-11-15), with 2 added later in f165757. The project has no logging framework, so stack traces were dumped to stderr, leaking internal class names and file paths. Worse,MavenPlugin.execute()returned normally after catching exceptions, causing Maven to report BUILD SUCCESS even when the tool failed completely.Verification