ghdl icon indicating copy to clipboard operation
ghdl copied to clipboard

Refactor file download error handling

Open sweep-ai[bot] opened this issue 1 year ago • 1 comments

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.

sweep-ai[bot] avatar Aug 05 '23 03:08 sweep-ai[bot]

Also refactor this commit: sweep: https://github.com/beetcb/ghdl/commit/1f17aa96e33c912de7557612df3e628d5f91ebaf

beetcb avatar Aug 05 '23 03:08 beetcb