Skip to content

Commit

Permalink
[rb] make sure command execution errors get rescued
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Nov 29, 2022
1 parent 769cd05 commit a8f4184
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rb/lib/selenium/webdriver/common/selenium_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8f4184

Please sign in to comment.