django-watchman
django-watchman copied to clipboard
@check decorator not properly handling exceptions
from watchman.decorators import check
@check
def my_check():
raise Exception("test")
gives the following traceback (Django 2.2.4, python 3.6.7) :
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/usr/local/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/watchman/decorators.py", line 107, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/watchman/views.py", line 163, in dashboard
for outer_status in value:
TypeError: 'bool' object is not iterable
It seems this may be answered by a previous message I sent: https://github.com/mwarkentin/django-watchman/issues/77#issuecomment-215173249
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closing as I've provided a proper way to write custom checks in the docs in #190.