Skip to content

Commit 11def6f

Browse files
committed
fix bad logic about when to bubble up exceptions in callbacks
1 parent 3afc270 commit 11def6f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rb/lib/selenium/webdriver/common/websocket_connection.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ def callback_thread(params)
178178
rescue Error::WebDriverError, *CONNECTION_ERRORS => e
179179
WebDriver.logger.debug "Callback aborted: #{e.class}: #{e.message}", id: :ws
180180
rescue StandardError => e
181-
# Do not allow an error raised during bidi interception to prevent potential deadlock
182-
Thread.main.raise(e) unless @closing || params['isBlocked']
181+
# Main thread needs to know that it can stop waiting
182+
Thread.main.raise(e) if params['isBlocked']
183+
return if @closing
183184

184-
condition = @closing ? 'on closing' : 'during interception'
185185
bt = Array(e.backtrace).first(5).join("\n")
186-
WebDriver.logger.error "Callback error #{condition}: #{e.class}: #{e.message}\n#{bt}", id: :ws
186+
WebDriver.logger.error "Callback error: #{e.class}: #{e.message}\n#{bt}", id: :ws
187187
end
188188
end
189189

0 commit comments

Comments
 (0)