Bladeren bron

Use built-in exception catching system

Instead of reinventing the square wheel
Sullivan SENECHAL 9 jaren geleden
bovenliggende
commit
99d01eff1d
1 gewijzigde bestanden met toevoegingen van 4 en 9 verwijderingen
  1. 4 9
      Security/Handler/AclSecurityHandler.php

+ 4 - 9
Security/Handler/AclSecurityHandler.php

@@ -214,15 +214,10 @@ class AclSecurityHandler implements AclSecurityHandlerInterface
     {
     {
         try {
         try {
             $acls = $this->aclProvider->findAcls(iterator_to_array($oids), $sids);
             $acls = $this->aclProvider->findAcls(iterator_to_array($oids), $sids);
-        } catch (\Exception $e) {
-            if ($e instanceof NotAllAclsFoundException) {
-                $acls = $e->getPartialResult();
-            } elseif ($e instanceof AclNotFoundException) {
-                // if only one oid, this error is thrown
-                $acls = new \SplObjectStorage();
-            } else {
-                throw $e;
-            }
+        } catch (NotAllAclsFoundException $e) {
+            $acls = $e->getPartialResult();
+        } catch (AclNotFoundException $e) { // if only one oid, this error is thrown
+            $acls = new \SplObjectStorage();
         }
         }
 
 
         return $acls;
         return $acls;