diff --git a/health_check/storage/backends.py b/health_check/storage/backends.py index ec58f8b8..4f61896c 100644 --- a/health_check/storage/backends.py +++ b/health_check/storage/backends.py @@ -10,7 +10,7 @@ from django.core.files.storage import get_storage_class from health_check.backends import BaseHealthCheckBackend -from health_check.exceptions import ServiceUnavailable +from health_check.exceptions import HealthCheckException, ServiceUnavailable class StorageHealthCheck(BaseHealthCheckBackend): @@ -75,6 +75,8 @@ def check_status(self): file_name = self.check_save(file_name, file_content) self.check_delete(file_name) return True + except HealthCheckException: + raise except Exception as e: raise ServiceUnavailable("Unknown exception") from e