Opened 5 years ago

Closed 20 months ago

#17617 closed Cleanup/optimization (fixed)

Middleware Loader swallows useful stacktraces

Reported by: davedash Owned by: nobody
Component: Core (Other) Version: master
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.

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=722497

Change History (2)

comment:1 Changed 5 years ago by Claude Paroz

Component: UncategorizedCore (Other)
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization
Version: 1.3SVN

Maybe just letting the ImportError uncatched? What is the value added by the encapsulation in a ImproperlyConfigured exception?

comment:2 Changed 20 months ago by Berker Peksag

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top