Create error classes
Create base error classes:
class HealthCheckException(Exception):
pass
class HealthCheckError(HealthCheckException):
pass
class HealthCheckWarning(HealthCheckException):
pass
Create error classes for each error case we check:
class AvailableMemoryLow(HealthCheckWarning):
pass
class AvailableMemoryCriticallyLow(HealthCheckWarning):
pass
When we catch an error:
try:
do_something()
except HealthCheckException e:
do_something() report fail
except Exception e:
unexpected error, report differently
For reporter, create a setting to see system errors
report_system_errors: true
report_debug_logs: true
If report_system_errors
is set to false
, do not raise error flag when a system error occurs. If report_debug_logs
is set to true
, print all traceback debug logs to report.