Bug 23010: Handle error in C4/Items.pm using try/catch

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 316f8bc4b8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Lucas Gass 2025-05-08 21:28:23 +00:00 committed by Paul Derscheid
parent 845171e4aa
commit c6986364ef
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 11 additions and 1 deletions

View File

@ -1732,7 +1732,17 @@ sub ToggleNewStatus {
$item->$field($value);
push @{ $report->{$itemnumber} }, $substitution;
}
$item->store unless $report_only;
unless ($report_only) {
try {
$item->store;
} catch {
push @{ $report->{$itemnumber} }, {
field => 'ERROR',
error => 1,
value => $_->error,
}
}
}
}
}