File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff 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 ( ) ;
Original file line number Diff line number Diff 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 ) )
You can’t perform that action at this time.
0 commit comments