Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e6f2fea

Browse files
author
tom-englert
committedFeb 26, 2024·
Revert improved error message
1 parent 178f92c commit e6f2fea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/Testcontainers/Builders/CommonDirectoryPath.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@ public static CommonDirectoryPath GetCallerFileDirectory([CallerFilePath, NotNul
107107

108108
private static string GetDirectoryPath(string path, string searchPattern)
109109
{
110-
return GetDirectoryPath(Directory.Exists(path) ? new DirectoryInfo(path) : null, searchPattern, path);
110+
return GetDirectoryPath(Directory.Exists(path) ? new DirectoryInfo(path) : null, searchPattern);
111111
}
112112

113-
private static string GetDirectoryPath(DirectoryInfo path, string searchPattern, string originalPath)
113+
private static string GetDirectoryPath(DirectoryInfo path, string searchPattern)
114114
{
115115
if (path != null)
116116
{
117-
return path.EnumerateFileSystemInfos(searchPattern, SearchOption.TopDirectoryOnly).Any() ? path.FullName : GetDirectoryPath(path.Parent, searchPattern, originalPath);
117+
return path.EnumerateFileSystemInfos(searchPattern, SearchOption.TopDirectoryOnly).Any() ? path.FullName : GetDirectoryPath(path.Parent, searchPattern);
118118
}
119119

120-
var message = $"Cannot find '{searchPattern}' and resolve the base directory in the directory tree of '{originalPath}'.";
120+
var message = $"Cannot find '{searchPattern}' and resolve the base directory in the directory tree.";
121121
throw new DirectoryNotFoundException(message);
122122
}
123123
}

0 commit comments

Comments
 (0)
Please sign in to comment.