@@ -132,16 +132,25 @@ private function getForwardedEduPersonEntitlement(&$request)
132132
133133 if (!isset ($ request ['perun ' ]['user ' ])) {
134134 Logger::debug (
135- 'perun:PerunEntitlement: Object Perun User is not specified. => Skipping getting forwardedEntitlement. '
135+ 'perun:PerunEntitlement: Object Perun User is not specified. ' .
136+ '=> Skipping getting forwardedEntitlement. '
136137 );
137138 return $ forwardedEduPersonEntitlement ;
138139 }
139140
140141 $ user = $ request ['perun ' ]['user ' ];
141- $ forwardedEduPersonEntitlementMap = $ this ->adapter ->getUserAttributes (
142- $ user ,
143- [$ this ->forwardedEduPersonEntitlement ]
144- );
142+
143+ try {
144+ $ forwardedEduPersonEntitlementMap = $ this ->adapter ->getUserAttributes (
145+ $ user ,
146+ [$ this ->forwardedEduPersonEntitlement ]
147+ );
148+ } catch (Exception $ exception ) {
149+ Logger::error (
150+ 'perun:PerunEntitlement: Exception ' . $ exception ->getMessage () .
151+ ' was thrown in method \'getForwardedEduPersonEntitlement \'. '
152+ );
153+ }
145154
146155 if (!empty ($ forwardedEduPersonEntitlementMap )) {
147156 $ forwardedEduPersonEntitlement = array_values ($ forwardedEduPersonEntitlementMap )[0 ];
@@ -152,12 +161,22 @@ private function getForwardedEduPersonEntitlement(&$request)
152161
153162 private function getCapabilities (&$ request )
154163 {
164+ $ resourceCapabilities = [];
165+ $ facilityCapabilities = [];
166+ $ capabilitiesResult = [];
167+
155168 $ spEntityId = $ this ->getSpEntityId ($ request );
156- $ resourceCapabilities = $ this ->adapter ->getResourceCapabilities ($ spEntityId , $ request ['perun ' ]['groups ' ]);
157- $ facilityCapabilities = $ this ->adapter ->getFacilityCapabilities ($ spEntityId );
169+ try {
170+ $ resourceCapabilities = $ this ->adapter ->getResourceCapabilities ($ spEntityId , $ request ['perun ' ]['groups ' ]);
171+ $ facilityCapabilities = $ this ->adapter ->getFacilityCapabilities ($ spEntityId );
172+ } catch (Exception $ exception ) {
173+ Logger::error (
174+ 'perun:PerunEntitlement: Exception ' . $ exception ->getMessage () .
175+ ' was thrown in method \'getCapabilities \'. '
176+ );
177+ }
158178
159179 $ capabilities = array_unique (array_merge ($ resourceCapabilities , $ facilityCapabilities ));
160- $ capabilitiesResult = [];
161180
162181 foreach ($ capabilities as $ capability ) {
163182 $ wrappedCapability = $ this ->capabilitiesWrapper ($ capability );
0 commit comments