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

Raise HealthCheckException directly from BaseStorageBackend.check_status #435

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion health_check/storage/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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

Expand Down