#4518 closed defect (fixed)
requesting non-existant ticket: 500 instead of 404
Reported by: | bubblboy at gmail | Owned by: | Emmanuel Blot |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | ticket system | Version: | 0.10.3 |
Severity: | trivial | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Hi,
When requesting a non-existant ticket on a trac system, I found that it returned a 500 Internal Error header, rather than a 404 as I would have expected. The message correctly stated that "Ticket 19172341243 does not exist.", so I was thinking it would be nicer to return a 404? it was on a trac with url-rewrite enabled: /ticket/19172341243.
Attachments (2)
Change History (6)
comment:1 by , 18 years ago
Component: | general → ticket system |
---|---|
Milestone: | → 0.11 |
Severity: | normal → trivial |
by , 18 years ago
comment:2 by , 18 years ago
Keywords: | review added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
I've attached a patch to implement this feature.
I've also added the same functionality for non-existant changesets and reports, along with non-existant tickets.
by , 17 years ago
Attachment: | 4518-ResourceNotFound.diff added |
---|
New version, using a new ResourceNotFoundError exception
comment:3 by , 17 years ago
Adding 4518-ResourceNotFound.diff that follows cboos' suggestion about introducing a specialized ResourceNotFoundError
exception.
comment:4 by , 17 years ago
Keywords: | review removed |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Looks good, except for the exception name which I renamed to simply ResourceNotFound
.
As for where to put the definition of this exception, I think it will later go in a new source:trunk/trac/resource.py file, together with the ResourceDescriptor
class, but I'll probably start a new branch for that.
Committed as r5554.
Proposal to fix this ticket