Skip to content

Commit b825ab4

Browse files
optimizely/user_profile.py -> Added error handling logic
1 parent 8359498 commit b825ab4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

optimizely/user_profile.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ def load_user_profile(self, reasons: Optional[list[str]] = [],
134134
message = str(exception)
135135
reasons.append(message)
136136
self.logger.exception(f'Unable to retrieve user profile for user "{self.user_id}" as lookup failed.')
137+
if error_handler:
138+
error_handler.handle_error(exception)
137139

138140
def update_user_profile(self, experiment: Experiment, variation: Variation) -> None:
139141
variation_id = variation.id
@@ -151,3 +153,5 @@ def save_user_profile(self, error_handler: Optional[BaseErrorHandler] = None) ->
151153
except Exception as exception:
152154
self.logger.warning(f'Failed to save user profile of user "{self.user_profile.user_id}" '
153155
f'for exception:{exception}".')
156+
if error_handler:
157+
error_handler.handle_error(exception)

0 commit comments

Comments
 (0)