Opened 11 years ago
Closed 11 years ago
#20841 closed Cleanup/optimization (fixed)
NotImplementedErrors should provide exception messages
Reported by: | Owned by: | Tim Clifford | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | NotImplementedError |
Cc: | joseph@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The Django source has many occurrences of NotImplementedErrors raised without a message. For example, if a dev creates a class inheriting from contrib.admin.SimpleListFilter and does not provide a lookups() method, all they see from the Debug template is "NotImplementedError at /path/to/file/ No exception supplied". This, in my opinion, makes seeking help difficult for those not comfortable enough to dig through the Django source. A simple message such as "instances of SimpleListFilter must provide a lookups() method" provides instant feedback and a non-ambiguous means to seeking help if needed.
In short, my request is to have all NotImplementedError exceptions raised accompanied by a message.
I realize this change would be boring to work on, so I am more than willing to read through the patch procedures and submit a patch myself if you all find this a worthy cause. (The nature of this request may even be simple enough to send through Github)
Change History (5)
comment:1 by , 11 years ago
Component: | Uncategorized → Core (Other) |
---|---|
Triage Stage: | Unreviewed → Accepted |
Version: | 1.5 → master |
comment:2 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 11 years ago
Pull request submitted and awaiting review. 92 instances of "raise NotImplementedError" used to placehold base class methods for subclassing were given verbose may/must subclass explanations, and two instances of not-implemented features were written up as well (found in /utils/datetime.py line #67 and /utils/regex_helper.py line #95).
comment:4 by , 11 years ago
Has patch: | set |
---|
Added a patch in the form of a Pull Request, visible here:
https://github.com/django/django/pull/1569
comment:5 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Looks like gruntwork that requires a base level of code literacy, which is perfect to assign during a sprint.
I'm on it!