From b259c4b4252cde8e7926690f6ba419d2ee7c59fc Mon Sep 17 00:00:00 2001 From: "bbaetz%acm.org" <> Date: Wed, 2 Apr 2003 20:35:00 +0000 Subject: Bug 199813 - Make all users of ThrowUserError pass $vars in explicitly. r=gerv a=justdave --- duplicates.cgi | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'duplicates.cgi') 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 -- cgit v1.2.3-24-g4f1b