Skip to content

Commit 379e0bf

Browse files
committed
Better exception when directory not found
1 parent 6258f12 commit 379e0bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Library/DiscUtils.Fat/FatFileSystem.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,9 @@ public override IEnumerable<string> GetDirectories(string path, string searchPat
11281128
/// <returns>Array of files.</returns>
11291129
public override IEnumerable<string> GetFiles(string path)
11301130
{
1131-
var dir = GetDirectory(path);
1131+
var dir = GetDirectory(path)
1132+
?? throw new DirectoryNotFoundException($"The directory '{path}' was not found");
1133+
11321134
var entries = dir.GetFiles();
11331135

11341136
foreach (var dirEntry in entries)

0 commit comments

Comments
 (0)