From f9dd8bcd3a9aca388dfe1cc73be6192279a1b132 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Tue, 16 May 2006 22:07:07 +0000 Subject: [PATCH] Bug 337701: 012throwables.t doesn't recognize that certain errors are AUTH_ERROR codes Patch By Max Kanat-Alexander r=LpSolit, a=justdave --- webtools/bugzilla/t/012throwables.t | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/webtools/bugzilla/t/012throwables.t b/webtools/bugzilla/t/012throwables.t index 2c7a5998b4a..8bc749686d1 100644 --- a/webtools/bugzilla/t/012throwables.t +++ b/webtools/bugzilla/t/012throwables.t @@ -113,9 +113,18 @@ foreach my $file (keys %test_modules) { last if $line =~ /^__END__/; # skip the POD (at least in # Bugzilla/Error.pm) $lineno++; - if ($line =~ /^[^#]*Throw(Code|User)Error\s*\(\s*["'](.*?)['"]/) { - my $errtype = lc($1); - my $errtag = $2; + if ($line =~ +/^[^#]*(Throw(Code|User)Error|error\s+=>)\s*\(?\s*["'](.*?)['"]/) { + my $errtype; + # If it's a normal ThrowCode/UserError + if ($2) { + $errtype = lc($2); + } + # If it's an AUTH_ERROR tag + else { + $errtype = 'code'; + } + my $errtag = $3; push @{$Errors{$errtype}{$errtag}{used_in}{$file}}, $lineno; } }