diff --git a/selene/core/wait.py b/selene/core/wait.py index 20d9d99e..3412cb91 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)