summaryrefslogtreecommitdiffstats
path: root/whine.pl
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2011-11-28 17:51:37 +0100
committerDave Lawrence <dlawrence@mozilla.com>2011-11-28 17:51:37 +0100
commit969f20eadc0d3ca5440d69e4afbae70d66f41b57 (patch)
treeb71ce564c9f8c60ba2c8870fa1e596c4a0e680c3 /whine.pl
parent0d3a92e3c8ed0b80e08a13536358d5346b8015fd (diff)
parent2fe1db36b3ced43ca9b76a5fbc293c845fd13066 (diff)
downloadbugzilla-969f20eadc0d3ca5440d69e4afbae70d66f41b57.tar.gz
bugzilla-969f20eadc0d3ca5440d69e4afbae70d66f41b57.tar.xz
merged with bugzilla/4.2
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..ad6067228 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 STDERR get_text('whine_query_failed', { query_name => $thisquery->{'name'},
+ author => $args->{'author'},
+ reason => $@ }) . "\n";
+ next;
+ }
+
$sth = $dbh->prepare($sqlquery);
$sth->execute;