You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically I have a custom middleware class that has a process_exception method, but if I also have debug toolbar enabled with the profiling panel added in DEBUG_TOOLBAR_PANELS than the process_exception method in my middleware class will never fire, I can see the traceback for the error occuring but the returned response is a standard django 500 debug page.
Middleware:
class MyMiddleware(MiddlewareMixin):
def process_exception(self, request, exception):
print("Exception!")
This duplicates #497 I've just noticed. It would be nice if there was some sort of warning raised because this broke for me in an extremely non-obvious way
#1132 will make this worse... I wonder what the best way to fix this might be.
It seems to me that this just surfaces the brokenness of the old way of writing Django middleware (process_view / process_response / process_exception)
I detailed my experiments with this here: https://stackoverflow.com/questions/54346767/django-2-0-custom-middleware-process-exception-hook-not-firing?noredirect=1#comment95511527_54346767
Basically I have a custom middleware class that has a
process_exception
method, but if I also have debug toolbar enabled with the profiling panel added inDEBUG_TOOLBAR_PANELS
than theprocess_exception
method in my middleware class will never fire, I can see the traceback for the error occuring but the returned response is a standard django 500 debug page.Middleware:
Activated middleware
Panels:
The text was updated successfully, but these errors were encountered: