#11283 closed defect (fixed)
InterTrac link to non-existent changeset results in inaccurate error message
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | wiki system | Version: | 1.0-stable |
Severity: | normal | Keywords: | intertrac, changeset, traclinks |
Cc: | Branch: | ||
Release Notes: |
Improved error message for an intertrac link to a non-existent or forbidden changeset. |
||
API Changes: | |||
Internal Changes: |
Description
For example, changeset/1000000 leads to a page displaying:
Error: Invalid Changeset Number
TracGuide — The Trac User and Administration Guide
However, [trac 1000000] leads to a page displaying:
Error: Forbidden
TracGuide — The Trac User and Administration Guide
Attachments (0)
Change History (8)
comment:1 by , 11 years ago
Keywords: | intertrac traclink changeset added |
---|---|
Milestone: | → next-stable-1.0.x |
Owner: | set to |
Status: | new → assigned |
comment:2 by , 11 years ago
comment:3 by , 11 years ago
Milestone: | next-stable-1.0.x → 1.0.2 |
---|
comment:4 by , 11 years ago
Should I commit this to trunk rather than 1.0-stable since it changes a translatable string and it's not a fix for a major functional issue?
comment:5 by , 11 years ago
I think that pushing to 1.0-stable is okay because the changesets after 1.0.1, e.g. r11777, have been changed the translation messages.
comment:6 by , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:7 by , 11 years ago
Keywords: | intertrac traclink changeset → intertrac, traclink, changeset |
---|
comment:8 by , 11 years ago
Keywords: | traclinks added; traclink removed |
---|
The error message looks strange because the "message" is being passed as the first argument and is being assigned to the parameter
action
. We should at least be using a keyword argument for the msg parameter.We could try to check if the resource exists, and raise different exception depending on whether the issue is resource existence or authorization. That seems like a bit of work though, and for now I'd just propose the following:
trac/wiki/intertrac.py
This change results in:
Error: Forbidden
TracGuide — The Trac User and Administration Guide
Maybe it is more appropriate to raise a
TracError
rather than aPermissionError
.trac/wiki/intertrac.py
from trac.perm import PermissionErrorTrac Error
TracGuide — The Trac User and Administration Guide