diff options
Diffstat (limited to 'whine.pl')
-rwxr-xr-x | whine.pl | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; |