Bug 37508: Don't return Internal server error when running report

To test:
1 - Create a report like:
SELECT "a"
FROM borrowers
WHERE <<Test>> != ''
2 - Run report
3 - Enter "password"
4 - Internal server error / stacktrace
5 - Apply patch
6 - Repeat
7 - Get a yellow warning box

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2024-08-12 12:10:12 +00:00 committed by Tomas Cohen Arazi
parent 4ad45ac37b
commit e3d2c38a1f
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -846,7 +846,7 @@ elsif ($phase eq 'Run this report'){
);
my $total;
if (!$sth) {
die "execute_query failed to return sth for report $report_id: $sql";
push @errors, "Report could not be run " . $errors;
} elsif ( !$errors ) {
$total = nb_rows($sql) || 0;
my $headers = header_cell_loop($sth);