Currently, hospital is binary: pass or fail.
Sometimes information is not blocker, so we do not want an error, but a warning.
As an example, while I check for example.com availability, I want a failure if it does not return HTTP 200 within 1 second. But I want a warning if it is "slow" i.e. if answer was received in more than 0.5 second.
Perhaps using logging would be smarter than using exeptions for that purpose:
While running the healthchecks, catch AssertionError and convert them into logger.error()
Healthchecks may log warnings, debug or info too.
The healthcheck view (CLI or WSGI) displays the logs.
The healthcheck view (CLI or WSGI) returns success if there is no log of level error/critical. It returns failure if there are logs of level error/critical.
Currently, hospital is binary: pass or fail. Sometimes information is not blocker, so we do not want an error, but a warning.
As an example, while I check for example.com availability, I want a failure if it does not return HTTP 200 within 1 second. But I want a warning if it is "slow" i.e. if answer was received in more than 0.5 second.
See: