summaryrefslogtreecommitdiffstats
path: root/whine.pl
diff options
context:
space:
mode:
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;