From 31e66b2ed85f490470559ebbc1754a262ac5e480 Mon Sep 17 00:00:00 2001 From: JacekZ <119878576+jacekziembla@users.noreply.github.com> Date: Fri, 9 Feb 2024 20:39:05 +0100 Subject: [PATCH] FIX: Fix error message thrown by selenium exceptions upon wait Currently we were casting entire exception to the string (including not readable stacktrace) from selenium to error message. Instead, we should pass just the error message --- selene/core/wait.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/selene/core/wait.py b/selene/core/wait.py index 20d9d99ed..3412cb911 100644 --- a/selene/core/wait.py +++ b/selene/core/wait.py @@ -119,11 +119,9 @@ def logic(fn: Callable[[E], R]) -> R: return fn(self.entity) except Exception as reason: if time.time() > finish_time: - reason_message = str(reason) - reason_string = '{name}: {message}'.format( name=reason.__class__.__name__, - message=reason_message, + message=getattr(reason, "msg", None), ) # TODO: think on how can we improve logging failures in selene, e.g. reverse msg and stacktrace # stacktrace = getattr(reason, 'stacktrace', None)