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

Fix the error propagation of the "source download" command #395

Conversation

primeos-work
Copy link
Member

The additional source verification in 2f8034b introduced a regression by returning the source verification errors before the errors of the download operation (the download errors therefore get omitted and users get misleading errors that the sources are missing and that the verification did therefore fail).

This restores the proper error messages and avoids unnecessary source verification by returning errors of the download operation before triggering the verification.

We also don't need the debug output as we already return the errors and I've put Ok(()) at the end to make it a bit more readable.


Before:

$ butido source download vim =9.0.1050
[00:00:03] (100%): ████████████████████████████████████████ | Repository loading finished                                                                                                             [00:00:00] (100%): ████████████████████████████████████████ | At least one download of 1 failed                                                                                                       [00:00:00] (100%): ████████████████████████████████████████ | Source verification failed                                                                                                              Error: Source missing: /srv/butido/sources/vim-9.0.1050/src.source

Error: source command failed

Caused by:
    At least one package failed with source verification

After:

$ butido source download vim =9.0.1050
[00:00:03] (100%): ████████████████████████████████████████ | Repository loading finished                                                                                                             [00:00:00] (100%): ████████████████████████████████████████ | At least one download of 1 failed                                                                                                       Error: source command failed

Caused by:
    0: Downloading "https://github.com/vim/vim/archive/refs/tags/v9.0.1050-42.tar.gz" failed
    1: Received HTTP status code "404 Not Found" but "200 OK" is expected for a successful download

The additional source verification in 2f8034b introduced a regression by
returning the source verification errors before the errors of the
download operation (the download errors therefore get omitted and users
get misleading errors that the sources are missing and that the
verification did therefore fail).

This restores the proper error messages and avoids unnecessary source
verification by returning errors of the download operation before
triggering the verification.

We also don't need the debug output as we already return the errors and
I've put `Ok(())` at the end to make it a bit more readable.

Signed-off-by: Michael Weiss <michael.weiss@eviden.com>
@primeos-work primeos-work added this pull request to the merge queue Jul 15, 2024
Merged via the queue into science-computing:master with commit bf32e35 Jul 15, 2024
13 checks passed
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.

1 participant