From 24f062186a9b6dcdcefa79c12ae82b95243c7e41 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Thu, 15 Aug 2002 13:43:44 +0000 Subject: Bug 162066 - Fix callers of ThrowCodeError to use messages in code-error.html.tmpl. Patch by gerv; r=bbaetz. --- CGI.pl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'CGI.pl') diff --git a/CGI.pl b/CGI.pl index de2d38085..d16a94883 100644 --- a/CGI.pl +++ b/CGI.pl @@ -218,11 +218,13 @@ sub CheckFormField (\%$;\@) { SendSQL("SELECT description FROM fielddefs WHERE name=" . SqlQuote($fieldname)); my $result = FetchOneColumn(); if ($result) { - ThrowCodeError("A legal $result was not set.", undef, "abort"); + $vars->{'field'} = $result; } else { - ThrowCodeError("A legal $fieldname was not set.", undef, "abort"); + $vars->{'field'} = $fieldname; } + + ThrowCodeError("illegal_field", "abort"); } } @@ -233,9 +235,9 @@ sub CheckFormFieldDefined (\%$) { ) = @_; if (!defined $formRef->{$fieldname}) { - ThrowCodeError("$fieldname was not defined; " . - Param("browserbugmessage")); - } + $vars->{'field'} = $fieldname; + ThrowCodeError("undefined_field"); + } } sub BugAliasToID { @@ -876,7 +878,7 @@ sub DisplayError { # For "this shouldn't happen"-type places in the code. # $vars->{'variables'} is a reference to a hash of useful debugging info. sub ThrowCodeError { - ($vars->{'error'}, $vars->{'variables'}, my $unlock_tables) = (@_); + ($vars->{'error'}, my $unlock_tables, $vars->{'variables'}) = (@_); SendSQL("UNLOCK TABLES") if $unlock_tables; -- cgit v1.2.3-24-g4f1b