Move Throw{Code,Template}Error into Error.pm

RESOLVED FIXED in Bugzilla 2.18

Status

()

enhancement
P1
normal
RESOLVED FIXED
16 years ago
7 years ago

People

(Reporter: bbaetz, Assigned: bbaetz)

Tracking

2.17.4
Bugzilla 2.18
Dependency tree / graph
Bug Flags:
approval +

Details

Attachments

(1 attachment, 2 obsolete attachments)

The remaining Throw functions need to get moved into a module. This requires me
to do what I did to ThrowUserError, and have callers pass in params, rather then
using the 'global' vars hash.

Note that this removes the current case of dumping passed explicitly to the end
of the message for a code error. All cases where this was done (except one,
which was probably an oversight, and I made teh error message do it) had this in
the main error text anyway. I left the use of the variables key to handle that,
so it can still be used if someone wants to for whatever reason.
Posted patch patch (obsolete) — Splinter Review
OK, here we go. Its streightforward. It may clash slightly with gerv's filter
patch and/or my dirname patch. Merging should be trivial, though.
Attachment #125206 - Flags: review?(gerv)
Blocks: bz-globals
+++ attachment.cgi	9 Jun 2003 03:10:24 -0000
>      $vars->{'contenttypemethod'} = $::FORM{'contenttypemethod'};
> -    ThrowCodeError("illegal_content_type_method");
> +    ThrowCodeError("illegal_content_type_method",
> +                   { contenttypemethod => $::FORM{'contenttypemethod'} });
Don't you want to remove the $vars line? I think this line is then no longer needed.

Bugzilla/Error.pm
> +manaully constructs urls without correct parameters.
"manually"

>+This function's behavious
"behavior" ?
Yeah, I'll make those changes. Thanks.
Posted patch v2 (obsolete) — Splinter Review
Fixes bitrot.
Attachment #125206 - Attachment is obsolete: true
Attachment #125206 - Attachment is obsolete: false
Attachment #125206 - Flags: review?(gerv)
Attachment #130639 - Flags: review?(justdave)
Posted patch Patch v3Splinter Review
save as v2, but removes bitrot.
Attachment #125206 - Attachment is obsolete: true
Attachment #130639 - Attachment is obsolete: true
Severity: normal → enhancement
OS: Linux → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → Bugzilla 2.18
Comment on attachment 131378 [details] [diff] [review]
Patch v3

Previous behavior of the ThrowCodeError routine was to take the extra variable
hash passed on the end and make that be the 'variables' hash that is displayed
under the error box.  Your new version no longer does this, instead requiring a
separate "variables" hash to be explicitly declared by the caller.  However,
nothing is done here to convert the calls that were already using this to
comply with the new requirement.

That's the only thing I can find wrong with this though. :)  Otherwise it looks
great.
Attachment #131378 - Flags: review-
Comment on attachment 131378 [details] [diff] [review]
Patch v3

OK, based on discussion in IRC, it appears none of the places that were calling
it this way previously really had a need to do so.  Since that was my only
objection, consider this reviewed. :)
Attachment #131378 - Flags: review- → review+
Checked in.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Note: I think you missed adding a "use Bugzilla::Error" to Series.pm here (bug
221160). Never mind :-)

Gerv
Actually, that's a bit of a slur - all the others had &:: in front of them
except one, so it was my fault really.

Gerv
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.