Adding Argument name to the Exception (#16372)
authorAnirudh Agnihotry <anirudhagnihotry098@gmail.com>
Wed, 14 Feb 2018 23:54:18 +0000 (15:54 -0800)
committerGitHub <noreply@github.com>
Wed, 14 Feb 2018 23:54:18 +0000 (15:54 -0800)
src/mscorlib/shared/System/IO/Path.Unix.cs
src/mscorlib/shared/System/IO/Path.Windows.cs

index 7e18a53..d104219 100644 (file)
@@ -47,13 +47,13 @@ namespace System.IO
         public static string GetFullPath(string path, string basePath)
         {
             if (path == null)
-                throw new ArgumentException(nameof(path));
+                throw new ArgumentNullException(nameof(path));
 
             if (basePath == null)
                 throw new ArgumentNullException(nameof(basePath));
 
             if (!IsPathFullyQualified(basePath))
-                throw new ArgumentException(SR.Arg_BasePathNotFullyQualified);
+                throw new ArgumentException(SR.Arg_BasePathNotFullyQualified, nameof(basePath));
 
             if (basePath.Contains('\0') || path.Contains('\0'))
                 throw new ArgumentException(SR.Argument_InvalidPathChars);
index 0d969db..eff8dea 100644 (file)
@@ -90,13 +90,13 @@ namespace System.IO
         public static string GetFullPath(string path, string basePath)
         {
             if (path == null)
-                throw new ArgumentException(nameof(path));
+                throw new ArgumentNullException(nameof(path));
 
             if (basePath == null)
                 throw new ArgumentNullException(nameof(basePath));
 
             if (!IsPathFullyQualified(basePath))
-                throw new ArgumentException(SR.Arg_BasePathNotFullyQualified);
+                throw new ArgumentException(SR.Arg_BasePathNotFullyQualified, nameof(basePath));
 
             if (basePath.Contains('\0') || path.Contains('\0'))
                 throw new ArgumentException(SR.Argument_InvalidPathChars);