Просмотр исходного кода

Merge branch 'hotfix/V8-7165-correction-pour-que-les-vnements'

Olivier Massot 9 месяцев назад
Родитель
Сommit
90c4900796
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      ot_connect/Classes/Service/OtAuthenticationService.php

+ 6 - 2
ot_connect/Classes/Service/OtAuthenticationService.php

@@ -162,7 +162,11 @@ class OtAuthenticationService extends AbstractAuthenticationService
         //   generated in the last minutes, to avoid unnecessary operations *
 
         if ($this->shouldUserBeUpdated($username, $isBackend)) {
-            $wasUpdated = $this->createOrUpdateUser($isBackend);
+            try {
+                $wasUpdated = $this->createOrUpdateUser($isBackend);
+            } catch (\RuntimeException) {
+                $wasUpdated = false;
+            }
 
             if (!$wasUpdated) {
                 // An error happened during the update of the user's data
@@ -414,7 +418,7 @@ class OtAuthenticationService extends AbstractAuthenticationService
         }
 
         if ($isBackend && empty($groupsUid)) {
-            throw new \Exception("No BE_group found for user " . $userApiData['username']);
+            throw new \RuntimeException("No BE_group found for user " . $userApiData['username']);
         }
 
         $user_row['usergroup'] = join(',', $groupsUid);