maven: surface real Ant/server error in AntExecutor failures#4911
Merged
shai-almog merged 2 commits intomasterfrom May 10, 2026
Merged
maven: surface real Ant/server error in AntExecutor failures#4911shai-almog merged 2 commits intomasterfrom
shai-almog merged 2 commits intomasterfrom
Conversation
The catch-all in AntExecutor threw a hardcoded "Unable to restart the
IEHS App" RuntimeException for every BuildException, masking the actual
cause. When a server build fails (e.g. an HTTP 500 from the build
server) the build client prints the response body and JSON error to
stdout but does not propagate it through the exception chain, so the
maven user only saw the misleading message.
Tee stdout/stderr while the Ant project runs, scan the captured output
for the server-error markers ("Response message from server is:",
"Server Detailed Error Message:", "Server returned HTTP response
code:") and include them in the thrown RuntimeException's message
alongside the underlying BuildException's message. Console output is
still forwarded to the original streams so the user-visible build log
is unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Compared 85 screenshots: 85 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 90 screenshots: 90 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Author
|
Compared 90 screenshots: 90 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Pass an explicit UTF-8 charset to the tee PrintStreams and to ByteArrayOutputStream.toString(). Also drop the now-unused getConsoleLogger() helper to silence UPM_UNCALLED_PRIVATE_METHOD. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
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
"!!! Unable to restart the IEHS App !!!"RuntimeException inAntExecutor(a stale boilerplate string from the file's borrowedsrccodes.comtemplate) with the actualBuildExceptionmessage so the failure is clear.System.out/System.errduring the Ant build and, on failure, scan the captured output for server-error markers (Response message from server is:,Server Detailed Error Message:,Server returned HTTP response code:) and append them to the thrown exception message. This surfaces the JSON body returned by the build server (which the build client prints to stdout but never propagates via the exception chain).AntExecutorTestcovering the marker extraction.Motivation
A Maven Android build that hit a server-side HTTP 500 on
/appsec/7.0/build/uploadproduced this misleading error:while the relevant detail —
{"timestamp":"...","status":500,"error":"Internal Server Error","path":"/appsec/7.0/build/upload"}— was visible only earlier in the log and not in the exception message.Test plan
mvn test -Dtest=AntExecutorTest— passes (3/3).mvn compileforcodenameone-maven-plugin— clean.🤖 Generated with Claude Code