Skip to content

Commit 09c1565

Browse files
committed
Bug and typos fix
1 parent af765fa commit 09c1565

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

WebDriverManager/DriverConfigs/Impl/ChromeConfig.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ public string GetBinaryName()
2828

2929
public string GetLatestVersion()
3030
{
31-
var webRequest = WebRequest.Create(@"https://chromedriver.storage.googleapis.com/LATEST_RELEASE");
31+
const string url = @"https://chromedriver.storage.googleapis.com/LATEST_RELEASE";
32+
var webRequest = WebRequest.Create(url);
3233
using (var response = webRequest.GetResponse())
3334
{
3435
using (var content = response.GetResponseStream())
3536
{
3637
if (content == null)
37-
throw new Exception(
38-
"Can't get content from URL", new Exception());
38+
throw new ArgumentNullException(
39+
$"Can't get content from URL: {url}");
3940
using (var reader = new StreamReader(content))
4041
{
4142
var version = reader.ReadToEnd().Trim();

WebDriverManager/Services/Impl/VariableService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected void UpdatePath(string path)
1414
{
1515
const string name = "PATH";
1616
var pathVariable = Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process);
17-
if (pathVariable == null) throw new Exception($"Can't get {name} variable");
17+
if (pathVariable == null) throw new ArgumentNullException($"Can't get {name} variable");
1818
path = Path.GetDirectoryName(path);
1919
var newPathVariable = $"{path};{pathVariable}";
2020
if (!pathVariable.Contains(path))

0 commit comments

Comments
 (0)