summaryrefslogtreecommitdiffstats
path: root/whine.pl
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2011-11-26 01:13:18 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2011-11-26 01:13:18 +0100
commit39a3753d0cd38ff1752b00f24627cbaba412848a (patch)
tree9790638d058d226f04629936b64b32a5b3380829 /whine.pl
parent80882f085e8918346ddb0ec3250f0d31ddaba5e6 (diff)
downloadbugzilla-39a3753d0cd38ff1752b00f24627cbaba412848a.tar.gz
bugzilla-39a3753d0cd38ff1752b00f24627cbaba412848a.tar.xz
Bug 255606: Do not let buglist.cgi return all bugs by default
r/a=mkanat
Diffstat (limited to 'whine.pl')
-rwxr-xr-xwhine.pl10
1 files changed, 9 insertions, 1 deletions
diff --git a/whine.pl b/whine.pl
index 7b8809c25..9b48c8eda 100755
--- a/whine.pl
+++ b/whine.pl
@@ -452,7 +452,15 @@ sub run_queries {
'params' => scalar $searchparams->Vars,
'user' => $args->{'recipient'}, # the search runs as the recipient
);
- my $sqlquery = $search->sql;
+ # If a query fails for whatever reason, it shouldn't kill the script.
+ my $sqlquery = eval { $search->sql };
+ if ($@) {
+ print get_text('whine_query_failed', { query_name => $thisquery->{'name'},
+ author => $args->{'author'},
+ reason => $@ }) . "\n";
+ next;
+ }
+
$sth = $dbh->prepare($sqlquery);
$sth->execute;