Skip to content

Improve Error Handling for Setup-Java Action to Help Debug Intermittent Failures #848

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gowridurgad
Copy link

Description:
Improves error handling to provide clearer messages when failures occur during Java setup, making it easier to identify the root cause of intermittent issues in workflows.

Related issue:
#793

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@gowridurgad gowridurgad marked this pull request as ready for review June 5, 2025 02:24
@Copilot Copilot AI review requested due to automatic review settings June 5, 2025 02:24
@gowridurgad gowridurgad requested a review from a team as a code owner June 5, 2025 02:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves error handling during Java setup by enhancing log messages and better distinguishing between different HTTP error statuses. Key changes include:

  • Introducing a try-catch block around the package download logic.
  • Adding distinct error logging for HTTP 403 and 429 errors.
  • Rethrowing errors after logging their details for further propagation.
Comments suppressed due to low confidence (1)

src/distributions/base-installer.ts:87

  • Consider wrapping the caught error with additional context before rethrowing to aid downstream debugging. For example, throwing a new Error with a message that includes details about the failure may improve error traceability.
throw error;

@gowridurgad gowridurgad self-assigned this Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants