Modify ↓
Opened 19 years ago
Closed 18 years ago
#4009 closed defect (fixed)
trac should response 404 not found instead of 500 when files is not found
| Reported by: | moo | Owned by: | Christian Boos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11 |
| Component: | general | Version: | 0.10 |
| Severity: | minor | Keywords: | http 404 |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Attachments (0)
Change History (6)
comment:1 by , 19 years ago
| Keywords: | http added |
|---|---|
| Milestone: | → 0.11 |
| Owner: | changed from to |
comment:2 by , 19 years ago
Why not just make the versioncontrol UI components catch NoSuchXxx and in turn raise HttpNotFound for now? I don't see why we need another exception layer there.
comment:3 by , 19 years ago
Well, raising MissingResource looks like a good intermediate between the catch-all TracError and the Web specific HTTPNotFound, so that we could do:
-
trac/web/main.py
260 260 raise err[0], err[1], err[2] 261 261 except PermissionError, e: 262 262 raise HTTPForbidden(to_unicode(e)) 263 except MissingResource, e: 264 raise HTTPNotFound(e.message) 263 265 except TracError, e: 264 266 raise HTTPInternalError(e.message) 265 267 finally:
comment:5 by , 18 years ago
| Keywords: | 404 added |
|---|---|
| Severity: | normal → minor |
| Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.



We should introduce a
MissingResourceerror, subclass ofTracErrorand from whichNoSuchNodewould inherit. The attachment code, ticket module etc. can raise the former directly.