Closed
Bug 372537
Opened 18 years ago
Closed 15 years ago
Improve CodeErrors: show the traceback (without function arguments)
Categories
(Bugzilla :: Bugzilla-General, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.0
People
(Reporter: mkanat, Assigned: mkanat)
Details
Attachments
(1 file, 1 obsolete file)
1.22 KB,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
Right now if Bugzilla::Object throws a CodeError, you have *no idea* where the actual problem is, since it doesn't tell you who the caller is. During a customization, I fixed this so that certain errors would give you more information about where you came from, and we should have that code upstream.
Assignee | ||
Comment 1•18 years ago
|
||
Okay, I just pulled this straight out of the NASA patch--I don't even know if it applies, but I think it should... :-)
Assignee | ||
Comment 2•18 years ago
|
||
Okay, I verified that it applies and compiles.
![]() |
||
Comment 3•18 years ago
|
||
Comment on attachment 257182 [details] [diff] [review]
v1
>=== modified file 'Bugzilla/Util.pm'
> sub css_class_quote {
> my ($toencode) = (@_);
>- $toencode =~ s/ /_/g;
>+ $toencode =~ s/[ :\/]/_/g;
I don't see why this change is required for this fix.
string_caller() has no POD.
>=== modified file 'Bugzilla/Object.pm'
> detaint_natural($id)
> || ThrowCodeError('param_must_be_numeric',
>+ {function => $class . '::_init',
>+ caller => caller_string(2) });
caller_string(2) won't return anything if you call |new Bugzilla::Foo()| from a CGI script and new() is not defined in the .pm module, such as |new Bugzilla::Product| called from editproducts.cgi.
IMO, you should display both caller_string(1) and caller_string(2), so that you get the complete path (caller_string(0) is useless as you would get Object->new in all cases). Except the problem above, your patch works fine.
Attachment #257182 -
Flags: review?(LpSolit) → review-
Assignee | ||
Updated•17 years ago
|
Target Milestone: Bugzilla 3.2 → Bugzilla 4.0
Assignee | ||
Comment 4•15 years ago
|
||
Okay, so I had a better idea. For all CodeErrors, show the full traceback. I leave out method arguments from the traceback, so it should always be pretty safe. Also, thanks to the way that code-error.html.tmpl already works, this only affects ERROR_MODE_WEBPAGE, so WebService clients won't suddenly start getting Bugzilla tracebacks, which is good.
Attachment #257182 -
Attachment is obsolete: true
Attachment #444359 -
Flags: review?(LpSolit)
Assignee | ||
Updated•15 years ago
|
Target Milestone: Bugzilla 4.0 → Bugzilla 3.8
![]() |
||
Updated•15 years ago
|
Attachment #444359 -
Flags: review?(LpSolit) → review+
![]() |
||
Comment 5•15 years ago
|
||
Comment on attachment 444359 [details] [diff] [review]
v2
Yeah, nice to have some more debug info. r=LpSolit
Note that this will not only affect Bugzilla::Object, but all calls to ThrowCodeError.
![]() |
||
Updated•15 years ago
|
Flags: approval+
Assignee | ||
Updated•15 years ago
|
Summary: Improve Bugzilla::Object CodeErrors: Show the Caller → Improve CodeErrors: show the traceback (without function arguments)
Assignee | ||
Comment 6•15 years ago
|
||
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Error.pm
modified template/en/default/global/code-error.html.tmpl
Committed revision 7168.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•