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

Handling of exceptions from kiwix::Downloader::close() #1081

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

veloman-yunkan
Copy link
Collaborator

Fixes #694

If saving the downloader state during exit fails+ then, instead of crashing, the following error is reported on stderr:

ERROR: Failed to save the downloader state: Failed to serialize session to '/nonexistingdir/kiwix.session'.


+It can happen, for example, if KIWIX_DATA_DIR is set to a non-existing directory which in addition cannot be created due to permissions.

@kelson42 kelson42 force-pushed the kiwix_Downloader_close_may_throw branch from 7f750c2 to 53494bf Compare April 12, 2024 05:03
@kelson42
Copy link
Collaborator

I have many remarks:

  • We should habe a section about this ENv variable and how it works in the README
  • I see no reason why we have such an ENV variable, why not kust removing it?

@veloman-yunkan
Copy link
Collaborator Author

@kelson42 Your remarks are valid but have nothing to do with this PR. kiwix::Downloader::close() can throw for a different reason (e.g. the directory ~/.local/share/kiwix being deleted while kiwix-desktop is running or the aria2 process dying).

@kelson42
Copy link
Collaborator

kelson42 commented Apr 12, 2024

@veloman-yunkan OK, will open a dedicated ticket.

@kelson42 kelson42 force-pushed the kiwix_Downloader_close_may_throw branch from 53494bf to 11cdeb9 Compare April 12, 2024 07:32
@kelson42 kelson42 merged commit 0b18cc6 into main Apr 12, 2024
4 checks passed
@kelson42 kelson42 deleted the kiwix_Downloader_close_may_throw branch April 12, 2024 10:48
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.

Unhandled kiwix::AriaError exception if KIWIX_DATA_DIR is set to a unexisting directory.
3 participants