Browse Source

try catch

Guillermo Espinoza 7 năm trước cách đây
mục cha
commit
5d423246bf
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      Twig/IsGrantedPreviousAdminExtension.php

+ 5 - 1
Twig/IsGrantedPreviousAdminExtension.php

@@ -44,7 +44,11 @@ class IsGrantedPreviousAdminExtension extends \Twig_Extension
      */
     public function isGrantedPreviousAdmin()
     {
-        return $this->webservice->makeGetRequest($this->urlBase . '/admin/user/is_granted');
+        try {
+            return $this->webservice->makeGetRequest($this->urlBase . '/admin/user/is_granted');
+        } catch (\Exception $e) {
+            return false;
+        }
     }
 
     /**