Skip to content

Refactor file download error handling#7

Open
sweep-ai-deprecated[bot] wants to merge 4 commits into
mainfrom
sweep/refactor-file-download-error-handling
Open

Refactor file download error handling#7
sweep-ai-deprecated[bot] wants to merge 4 commits into
mainfrom
sweep/refactor-file-download-error-handling

Conversation

@sweep-ai-deprecated
Copy link
Copy Markdown
Contributor

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.

@yaonyan
Copy link
Copy Markdown
Owner

yaonyan 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

Development

Successfully merging this pull request may close these issues.

sweep: figure out a better solution to do https://github.com/beetcb/ghdl/commit/1f17aa96e33c912de7557612df3e628d5f91ebaf

1 participant