Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 7 years ago

#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)

4518.diff (6.4 KB ) - added by Emmanuel Blot 18 years ago.
Proposal to fix this ticket
4518-ResourceNotFound.diff (8.7 KB ) - added by Emmanuel Blot 18 years ago.
New version, using a new ResourceNotFoundError exception

Download all attachments as: .zip

Change History (6)

comment:1 by Christian Boos, 18 years ago

Component: generalticket system
Milestone: 0.11
Severity: normaltrivial

by Emmanuel Blot, 18 years ago

Attachment: 4518.diff added

Proposal to fix this ticket

comment:2 by Emmanuel Blot, 18 years ago

Keywords: review added
Owner: changed from Jonas Borgström to Emmanuel Blot
Status: newassigned

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 Emmanuel Blot, 18 years ago

Attachment: 4518-ResourceNotFound.diff added

New version, using a new ResourceNotFoundError exception

comment:3 by Emmanuel Blot, 18 years ago

Adding 4518-ResourceNotFound.diff that follows cboos' suggestion about introducing a specialized ResourceNotFoundError exception.

comment:4 by Christian Boos, 18 years ago

Keywords: review removed
Resolution: fixed
Status: assignedclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Emmanuel Blot.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Emmanuel Blot to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.