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

Refactor file download error handling #7

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

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Aug 5, 2023

Description

This PR refactors the error handling in the file download process to provide a more robust and flexible error handling mechanism.

Summary of Changes

  • In dl.go:
    • Replaced the panic statement in the DlTo method of the GHReleaseDl struct with an error return. This ensures that errors during the file download process are returned to the caller function instead of abruptly stopping the program execution.
  • In ghdl/main.go:
    • Updated the Run function of the rootCmd variable to handle the error returned by the DlTo method. If an error is returned, an error message is printed and the program exits with a non-zero status code.

These changes improve the code's reliability and maintainability by providing a more controlled and predictable error handling mechanism.

Fixes #3.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/refactor-file-download-error-handling

To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.

@beetcb
Copy link
Owner

beetcb commented Aug 5, 2023

Also refactor this commit: sweep: 1f17aa9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
1 participant