Skip to content
Snippets Groups Projects
Verified Commit 48e9fe85 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Properly report I/O errors in backup check

parent 6f895443
No related branches found
No related tags found
1 merge request!920Resolve "Status page throws internal server error if backup directory not found"
......@@ -21,6 +21,7 @@ Fixed
* Phone numbers were not properly linked and suboptimally formatted on person page
* Favicon upload failed with S3 storage.
* Some preferences were required when they shouldn't, and vice versa.
* IO errors on accessing backup directory in health check are now properly reported
`2.6`_ - 2022-01-10
-------------------
......
......@@ -33,7 +33,13 @@ class BaseBackupHealthCheck(BaseHealthCheckBackend):
def check_status(self):
storage = get_storage()
backups = storage.list_backups(content_type=self.content_type)
try:
backups = storage.list_backups(content_type=self.content_type)
except Exception as ex:
self.add_error(_("Error accessing backup storage: {}").format(str(ex)))
return
if backups:
last_backup = backups[:1]
last_backup_time = dbbackup_utils.filename_to_date(last_backup[0])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment