From a8f4184e3c5add2f90f81222d881a6ef5bc0b6d6 Mon Sep 17 00:00:00 2001 From: titusfortner Date: Tue, 29 Nov 2022 15:24:59 -0600 Subject: [PATCH] [rb] make sure command execution errors get rescued --- rb/lib/selenium/webdriver/common/selenium_manager.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rb/lib/selenium/webdriver/common/selenium_manager.rb b/rb/lib/selenium/webdriver/common/selenium_manager.rb index bb6c09a65ee00..a0417bca706aa 100644 --- a/rb/lib/selenium/webdriver/common/selenium_manager.rb +++ b/rb/lib/selenium/webdriver/common/selenium_manager.rb @@ -73,7 +73,12 @@ def binary def run(command) WebDriver.logger.debug("Executing Process #{command}") - stdout, stderr, status = Open3.capture3(command) + begin + stdout, stderr, status = Open3.capture3(command) + rescue StandardError => e + raise Error::WebDriverError, "Unsuccessful command executed: #{command}", e + end + if status.exitstatus.positive? raise Error::WebDriverError, "Unsuccessful command executed: #{command}\n#{stdout}#{stderr}" end