Opened 13 years ago
Closed 10 years ago
#17617 closed Cleanup/optimization (fixed)
Middleware Loader swallows useful stacktraces
Reported by: | davedash | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This try/except block:
https://github.com/django/django/blob/master/django/core/handlers/base.py#L44
Swallows stacktraces that can help us track down problems. Simply outputting the error raised doesn't really explain what's going on... in our case it was an ImportError caused by a circular import, we had to comment out the try/except to expose it[1].
Not sure what a good way is to fix this, but I thought I'd at the very least mention it.
Change History (2)
comment:1 by , 13 years ago
Component: | Uncategorized → Core (Other) |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
Version: | 1.3 → SVN |
comment:2 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The try/except block described in the ticket description is at https://github.com/django/django/blob/stable/1.4.x/django/core/handlers/base.py#L42-45
As of Django 1.6+, ImportErrors are not wrapped by ImproperlyConfigured anymore:
Maybe just letting the ImportError uncatched? What is the value added by the encapsulation in a ImproperlyConfigured exception?