ExceptionHandlingMiddleware prevents further handling of exceptions #1865

Closed
opened 2025-12-29 17:19:53 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jul 24, 2018).

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation
[ ] Housekeeping

Environment

  • Python version: 3.5.2
  • NetBox version: 2.3.6

Description

NetBox employs custom middleware to help process exceptions and return custom error messages in response to some common problems (e.g. incorrect file system permissions). This middleware consumes all exceptions and renders the 500 response template directly. This prevents further processing of exceptions by log handlers such as AdminEmailHandler.

ExceptionHandlingMiddleware should be adapted so that it returns a response only if we want to render a custom error message.

Originally created by @jeremystretch on GitHub (Jul 24, 2018). ### Issue type [ ] Feature request <!-- An enhancement of existing functionality --> [x] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> [ ] Housekeeping <!-- Changes pertaining to the codebase itself --> ### Environment * Python version: 3.5.2 * NetBox version: 2.3.6 ### Description NetBox employs custom middleware to help process exceptions and return custom error messages in response to some common problems (e.g. incorrect file system permissions). This middleware consumes _all_ exceptions and renders the 500 response template directly. This prevents further processing of exceptions by log handlers such as [`AdminEmailHandler`](https://docs.djangoproject.com/en/2.0/topics/logging/#django.utils.log.AdminEmailHandler). `ExceptionHandlingMiddleware` should be adapted so that it returns a response only if we want to render a custom error message.
adam added the type: bugstatus: accepted labels 2025-12-29 17:19:53 +01:00
adam closed this issue 2025-12-29 17:19:53 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1865