From fb95957b6555b6ab5a666ca2fc146f84c6b58c10 Mon Sep 17 00:00:00 2001 From: Dan Jensen Date: Wed, 4 May 2022 15:19:52 -0500 Subject: [PATCH] Improve error messages for debugging This improves 2 error messages in ChromeFinder. Previously the messages could imply that a file could not be found, when it is more accurate to say that the binary location or version could not be determined. --- lib/webdrivers/chrome_finder.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/webdrivers/chrome_finder.rb b/lib/webdrivers/chrome_finder.rb index 8d72c49a..5ff6c3f4 100644 --- a/lib/webdrivers/chrome_finder.rb +++ b/lib/webdrivers/chrome_finder.rb @@ -8,7 +8,7 @@ class ChromeFinder class << self def version version = send("#{System.platform}_version", location) - raise VersionError, 'Failed to find Chrome version.' if version.nil? || version.empty? + raise VersionError, 'Failed to determine Chrome version.' if version.nil? || version.empty? Webdrivers.logger.debug "Browser version: #{version}" version[/\d+\.\d+\.\d+\.\d+/] # Google Chrome 73.0.3683.75 -> 73.0.3683.75 @@ -18,7 +18,7 @@ def location chrome_bin = user_defined_location || send("#{System.platform}_location") return chrome_bin unless chrome_bin.nil? - raise BrowserNotFound, 'Failed to find Chrome binary.' + raise BrowserNotFound, 'Failed to determine Chrome binary location.' end private