1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:47:45 +00:00

LibCore+Everywhere: Return an Error from DirIterator::error()

This also removes DirIterator::error_string(), since the same strerror()
string will be included when you print the Error itself. Except in `ls`
which is still using fprintf() for now.
This commit is contained in:
Sam Atkins 2023-03-01 15:55:15 +00:00 committed by Andreas Kling
parent a98ae8f357
commit 774f328783
17 changed files with 44 additions and 46 deletions

View file

@ -48,7 +48,7 @@ static void print_directory_tree(DeprecatedString const& root_path, int depth, D
Core::DirIterator di(root_path, flag_show_hidden_files ? Core::DirIterator::SkipParentAndBaseDir : Core::DirIterator::SkipDots);
if (di.has_error()) {
warnln("{}: {}", root_path, di.error_string());
warnln("{}: {}", root_path, di.error());
return;
}
@ -56,7 +56,7 @@ static void print_directory_tree(DeprecatedString const& root_path, int depth, D
while (di.has_next()) {
DeprecatedString name = di.next_path();
if (di.has_error()) {
warnln("{}: {}", root_path, di.error_string());
warnln("{}: {}", root_path, di.error());
continue;
}
names.append(name);