Browse Source

Use built-in exception catching system

Instead of reinventing the square wheel
Sullivan SENECHAL 9 năm trước cách đây
mục cha
commit
99d01eff1d
1 tập tin đã thay đổi với 4 bổ sung9 xóa
  1. 4 9
      Security/Handler/AclSecurityHandler.php

+ 4 - 9
Security/Handler/AclSecurityHandler.php

@@ -214,15 +214,10 @@ class AclSecurityHandler implements AclSecurityHandlerInterface
     {
         try {
             $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;