summaryrefslogtreecommitdiffstats
path: root/duplicates.cgi
diff options
context:
space:
mode:
authorbbaetz%acm.org <>2003-04-02 22:35:00 +0200
committerbbaetz%acm.org <>2003-04-02 22:35:00 +0200
commitb259c4b4252cde8e7926690f6ba419d2ee7c59fc (patch)
treeae51804f9db83c0b1a49f79b9e0a1848cdd5e7c7 /duplicates.cgi
parent747eb2ddd7febfa0e33ccf3797bf48db0defafcc (diff)
downloadbugzilla-b259c4b4252cde8e7926690f6ba419d2ee7c59fc.tar.gz
bugzilla-b259c4b4252cde8e7926690f6ba419d2ee7c59fc.tar.xz
Bug 199813 - Make all users of ThrowUserError pass $vars in explicitly.
r=gerv a=justdave
Diffstat (limited to 'duplicates.cgi')
-rwxr-xr-xduplicates.cgi23
1 files changed, 12 insertions, 11 deletions
diff --git a/duplicates.cgi b/duplicates.cgi
index a9a3031f3..1a3c08a9f 100755
--- a/duplicates.cgi
+++ b/duplicates.cgi
@@ -83,8 +83,8 @@ my $product_id;
if ($product) {
$product_id = get_product_id($product);
if (!$product_id) {
- $vars->{'product'} = $product;
- ThrowUserError("invalid_product_name");
+ ThrowUserError("invalid_product_name",
+ { product => $product });
}
}
@@ -109,17 +109,17 @@ if (!tie(%dbmcount, 'AnyDBM_File', "data/duplicates/dupes$today",
if ($!{ENOENT}) {
if (!tie(%dbmcount, 'AnyDBM_File', "data/duplicates/dupes$yesterday",
O_RDONLY, 0644)) {
- $vars->{'today'} = $today;
+ my $vars = { today => $today };
if ($!{ENOENT}) {
- ThrowUserError("no_dupe_stats");
+ ThrowUserError("no_dupe_stats", $vars);
} else {
$vars->{'error_msg'} = $!;
- ThrowUserError("no_dupe_stats_error_yesterday");
+ ThrowUserError("no_dupe_stats_error_yesterday", $vars);
}
}
} else {
- $vars->{'error_msg'} = $!;
- ThrowUserError("no_dupe_stats_error_today");
+ ThrowUserError("no_dupe_stats_error_today",
+ { error_msg => $! });
}
}
@@ -146,10 +146,11 @@ if (!tie(%before, 'AnyDBM_File', "data/duplicates/dupes$whenever",
O_RDONLY, 0644)) {
# Ignore file not found errors
if (!$!{ENOENT}) {
- $vars->{'error_msg'} = $!;
- $vars->{'changedsince'} = $changedsince;
- $vars->{'whenever'} = $whenever;
- ThrowUserError("no_dupe_stats_error_whenever");
+ ThrowUserError("no_dupe_stats_error_whenever",
+ { error_msg => $!,
+ changedsince => $changedsince,
+ whenever => $whenever,
+ });
}
} else {
# Calculate the deltas