bad URLs cause 500 errors where 404s would be expected
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charmworld |
Fix Released
|
Medium
|
Curtis Hovey |
Bug Description
My URL hack to verify errors are logged app.log as well as emailed illustrates a weakness in the code:
2013-04-29 18:13:55,183 http://
Traceback (most recent call last):
File "/home/
return handler(request)
File "/home/
response = view_callable(
File "/home/
result = view(context, request)
File "/home/
response = inst()
File "/home/
result = self._handle(
File "/home/
return handler(*args, **kwargs)
File "/home/
return self._handle(
UnboundLocalError: local variable 'handler' referenced before assignment
API0.charms() assumes it will always find a handler for the URL. I expect a 404 to be returned when I URL hack.
Related branches
- Aaron Bentley (community): Approve
-
Diff: 28 lines (+7/-0)2 files modifiedcharmworld/views/api.py (+2/-0)
charmworld/views/tests/test_api.py (+5/-0)
Changed in charmworld: | |
importance: | High → Medium |
Changed in charmworld: | |
assignee: | nobody → Curtis Hovey (sinzui) |
status: | Triaged → In Progress |
Changed in charmworld: | |
status: | In Progress → Fix Committed |
status: | Fix Committed → Fix Released |