From c9aaffd4541554af069e4ac097c39f567b02f55a Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Sat, 26 Nov 2011 01:08:58 +0100 Subject: Bug 255606: Do not let buglist.cgi return all bugs by default r/a=mkanat --- whine.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'whine.pl') diff --git a/whine.pl b/whine.pl index 7b8809c25..5e023d221 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 ($@) { + say get_text('whine_query_failed', { query_name => $thisquery->{'name'}, + author => $args->{'author'}, + reason => $@ }); + next; + } + $sth = $dbh->prepare($sqlquery); $sth->execute; -- cgit v1.2.3-24-g4f1b