From: Anirudh Agnihotry Date: Wed, 14 Feb 2018 23:54:18 +0000 (-0800) Subject: Adding Argument name to the Exception (#16372) X-Git-Tag: accepted/tizen/unified/20190422.045933~2963 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13abf204311e8c512603b5f9abb97113ad671bc1;p=platform%2Fupstream%2Fcoreclr.git Adding Argument name to the Exception (#16372) --- diff --git a/src/mscorlib/shared/System/IO/Path.Unix.cs b/src/mscorlib/shared/System/IO/Path.Unix.cs index 7e18a53..d104219 100644 --- a/src/mscorlib/shared/System/IO/Path.Unix.cs +++ b/src/mscorlib/shared/System/IO/Path.Unix.cs @@ -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); diff --git a/src/mscorlib/shared/System/IO/Path.Windows.cs b/src/mscorlib/shared/System/IO/Path.Windows.cs index 0d969db..eff8dea 100644 --- a/src/mscorlib/shared/System/IO/Path.Windows.cs +++ b/src/mscorlib/shared/System/IO/Path.Windows.cs @@ -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);