From: Galen Charlton Date: Mon, 15 Jun 2020 20:47:19 +0000 (-0400) Subject: LP#1879983: ensure that open-ils.curbside is optional X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2f9eb34f10fcf3a7dcac94b9546825b455ae0706;p=working%2FEvergreen.git LP#1879983: ensure that open-ils.curbside is optional This fixes a crash in My Account if the patron views their avaialable holds but open-ils.curbside isn't running. This isn't bulletproof; an Evergreen site that has enabled the circ.curbside library setting but doesn't have the open-ils.curbside service running will see difficulties. Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 75fc78d7d6..2fc2b701dd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -5,6 +5,7 @@ use OpenSRF::Utils::Logger qw/$logger/; use OpenILS::Utils::CStoreEditor qw/:funcs/; use OpenILS::Utils::Fieldmapper; use OpenILS::Application::AppUtils; +use OpenSRF::EX qw/:try/; use OpenILS::Event; use OpenSRF::Utils::JSON; use OpenSRF::Utils::Cache; @@ -1182,11 +1183,14 @@ sub fetch_user_holds { ); } - my $curbsides = $U->simplereq( - 'open-ils.curbside', - 'open-ils.curbside.fetch_mine.atomic', - $e->authtoken - ); + my $curbsides = []; + try { # if the service is not running, just let this fail silently + $curbsides = $U->simplereq( + 'open-ils.curbside', + 'open-ils.curbside.fetch_mine.atomic', + $e->authtoken + ); + } catch Error with {}; my @pickup_libs = sort { $U->find_org($U->get_org_tree,$a)->name cmp $U->find_org($U->get_org_tree,$b)->name } keys %pickup_libs;