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

Handle cache download errors #253

Merged
merged 2 commits into from
Jan 9, 2022
Merged

Handle cache download errors #253

merged 2 commits into from
Jan 9, 2022

Conversation

dbrgn
Copy link
Collaborator

@dbrgn dbrgn commented Jan 9, 2022

With this fix, when an invalid ZIP is downloaded:

  Error: Could not update cache

  Caused by:
      0: Could not decompress downloaded ZIP archive
      1: invalid Zip archive

When a non-successful HTTP error status is returned:

  Error: Could not update cache

  Caused by:
      0: Could not download tldr pages from https://tldr.sh/assets/tldr.zap
      1: HTTP status client error (404 Not Found) for url (https://tldr.sh/assets/tldr.zap)

Anyhow is awesome 🙂

Fixes #252.

@dbrgn dbrgn requested a review from niklasmohrin January 9, 2022 14:25
@dbrgn dbrgn self-assigned this Jan 9, 2022
dbrgn added 2 commits January 9, 2022 21:14
Do not unwrap. Instead, propagate the error with a anyhow context.
@dbrgn dbrgn force-pushed the handle-download-errors branch from c58952c to 77a6d48 Compare January 9, 2022 20:14
@dbrgn dbrgn requested a review from niklasmohrin January 9, 2022 20:14
@dbrgn dbrgn enabled auto-merge January 9, 2022 20:22
@dbrgn dbrgn merged commit b5443b7 into main Jan 9, 2022
@dbrgn dbrgn deleted the handle-download-errors branch January 10, 2022 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Fails to update cache: thread 'main' panicked (Arch Linux)
2 participants