From 60b331bc2a1d89296f5c57df34171db3b3eca409 Mon Sep 17 00:00:00 2001
From: "gerv%gerv.net" <>
Date: Wed, 2 Oct 2002 05:41:03 +0000
Subject: Bug 163114 - Templatise all calls to DisplayError. Patch C. Patch by
gerv; r=burnus.
---
process_bug.cgi | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
(limited to 'process_bug.cgi')
diff --git a/process_bug.cgi b/process_bug.cgi
index 4fb42d8b0..1e4fd28b7 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -84,9 +84,7 @@ if (defined $::FORM{'id'}) {
}
# Make sure there are bugs to process.
-scalar(@idlist)
- || DisplayError("You did not select any bugs to modify.")
- && exit;
+scalar(@idlist) || ThrowUserError("no_bugs_chosen");
# If we are duping bugs, let's also make sure that we can change
# the original. This takes care of issue A on bug 96085.
@@ -616,11 +614,9 @@ foreach my $field ("rep_platform", "priority", "bug_severity",
my $prod_id; # Remember, can't use this for mass changes
if ($::FORM{'product'} ne $::dontchange) {
$prod_id = get_product_id($::FORM{'product'});
- if (! $prod_id) {
- DisplayError("The " . html_quote($::FORM{'product'}) .
- " product doesn't exist.");
- exit;
- }
+ $prod_id ||
+ ThrowUserError("invalid_product_name", {product => $::FORM{'product'});
+
DoComma();
$::query .= "product_id = $prod_id";
} else {
@@ -637,12 +633,10 @@ if ($::FORM{'component'} ne $::dontchange) {
}
$comp_id = get_component_id($prod_id,
$::FORM{'component'});
- if (! $comp_id) {
- DisplayError("The " . html_quote($::FORM{'component'}) .
- " component doesn't exist in the " .
- html_quote($::FORM{'product'}) . " product");
- exit;
- }
+ $comp_id || ThrowCodeError("invalid_component",
+ {component => $::FORM{'component'},
+ product => $::FORM{'product'}});
+
DoComma();
$::query .= "component_id = $comp_id";
}
--
cgit v1.2.3-24-g4f1b