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

Improve backup error handling #31

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

andreasley
Copy link
Contributor

The recently added Database.backup() method fails to verify that the result of the last sqlite3_backup_step is SQLITE_DONE. If an error occurs while creating the backup (e.g. some IO error), the result might not be SQLITE_DONE.

This pull request adds this check and throws if the result is not SQLITE_DONE. It also ensures that the backup process is ended and the database connection is closed if an error occurs at any point.

However, I've not been able to actually make the backup fail, so I can't verify that the final check yields the correct error message.

Apologies for the oversight in the previous pull request.

@marcoarment marcoarment merged commit f894c00 into marcoarment:main Aug 26, 2024
1 check 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.

2 participants