Skip to content

Commit

Permalink
BUG: Return invalid Result<> if size of directory is requested. (#891)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson authored Mar 20, 2024
1 parent 381aecc commit 219471b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/simplnx/Utilities/FileUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ Result<> ValidateCSVFile(const std::string& filePath)

if(!fs::exists({absPath}))
{
return MakeErrorResult(-300, fmt::format("File does not exist: {}", absPath.string()));
return MakeErrorResult(-300, fmt::format("CSV file does not exist: {}", absPath.string()));
}
if(fs::is_directory({absPath}))
{
return MakeErrorResult(-301, fmt::format("CSV input file is a directory: {}", absPath.string()));
}

// Obtain the file size
Expand Down

0 comments on commit 219471b

Please sign in to comment.