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

RESOLVED FIXED in Bugzilla 2.18

Status

()

Bugzilla
Bugzilla-General
P1
enhancement
RESOLVED FIXED
15 years ago
6 years ago

People

(Reporter: bbaetz, Assigned: bbaetz)

Tracking

2.17.4
Bugzilla 2.18
Bug Flags:
approval +

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

15 years ago
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.
(Assignee)

Comment 1

15 years ago
Created attachment 125206 [details] [diff] [review]
patch

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.
(Assignee)

Updated

15 years ago
Attachment #125206 - Flags: review?(gerv)
(Assignee)

Updated

15 years ago
Blocks: 87411

Comment 2

15 years ago
+++ 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" ?
(Assignee)

Comment 3

15 years ago
Yeah, I'll make those changes. Thanks.
(Assignee)

Comment 4

15 years ago
Created attachment 130639 [details] [diff] [review]
v2

Fixes bitrot.
Attachment #125206 - Attachment is obsolete: true
(Assignee)

Updated

15 years ago
Attachment #125206 - Attachment is obsolete: false
Attachment #125206 - Flags: review?(gerv)
(Assignee)

Updated

15 years ago
Attachment #130639 - Flags: review?(justdave)
Created attachment 131378 [details] [diff] [review]
Patch v3

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+
Flags: approval+
(Assignee)

Comment 8

15 years ago
Checked in.
Status: NEW → RESOLVED
Last Resolved: 15 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.