Skip to content

Commit 25f8f06

Browse files
committed
log exception on kc update but confinue
1 parent 384f40d commit 25f8f06

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rasenmaeher_api/kchelpers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from libpvarki.schemas.product import UserCRUDRequest
88
from pydantic import BaseModel, Extra, Field
99
from keycloak.keycloak_admin import KeycloakAdmin
10+
from keycloak.exceptions import KeycloakError
1011

1112

1213
from .rmsettings import RMSettings
@@ -215,7 +216,10 @@ async def update_kc_user(self, user: KCUserData) -> Optional[KCUserData]:
215216
if rofieldname in send_payload["attributes"]:
216217
del send_payload["attributes"][rofieldname]
217218
LOGGER.debug("Sending payload: {}".format(send_payload))
218-
await self.kcadmin.a_update_user(user.kc_id, send_payload)
219+
try:
220+
await self.kcadmin.a_update_user(user.kc_id, send_payload)
221+
except KeycloakError as exc:
222+
LOGGER.exception("Could not update KC user: {}".format(exc))
219223
return await self._refresh_user(user.kc_id, pdata)
220224

221225
async def delete_kc_user(self, user: KCUserData) -> bool:

0 commit comments

Comments
 (0)