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:
parent
845171e4aa
commit
c6986364ef
12
C4/Items.pm
12
C4/Items.pm
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue