Skip to content

Commit 3c14c98

Browse files
committed
Fix FileNotFoundException messages to use correct path variable
1 parent e35badd commit 3c14c98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/System/IO/SystemFolder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public SystemFolder(string path)
3131
}
3232

3333
if (!Directory.Exists(path))
34-
throw new FileNotFoundException($"Directory not found at path '{Path}'.");
34+
throw new FileNotFoundException($"Directory not found at path '{path}'.");
3535

3636
// For consistency, always remove the trailing directory separator.
3737
Path = path.TrimEnd(global::System.IO.Path.PathSeparator, global::System.IO.Path.DirectorySeparatorChar, global::System.IO.Path.AltDirectorySeparatorChar);
@@ -44,7 +44,7 @@ public SystemFolder(string path)
4444
public SystemFolder(DirectoryInfo info)
4545
{
4646
if (!info.Exists)
47-
throw new FileNotFoundException($"Directory not found at path '{Path}'.");
47+
throw new FileNotFoundException($"Directory not found at path '{info.FullName}'.");
4848

4949
_info = info;
5050

0 commit comments

Comments
 (0)