mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:17:35 +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:
parent
a98ae8f357
commit
774f328783
17 changed files with 44 additions and 46 deletions
|
@ -142,8 +142,9 @@ ErrorOr<u64> print_space_usage(DeprecatedString const& path, DuOption const& du_
|
|||
if (is_directory) {
|
||||
auto di = Core::DirIterator(path, Core::DirIterator::SkipParentAndBaseDir);
|
||||
if (di.has_error()) {
|
||||
outln("du: cannot read directory '{}': {}", path, di.error_string());
|
||||
return Error::from_string_literal("An error occurred. See previous error.");
|
||||
auto error = di.error();
|
||||
outln("du: cannot read directory '{}': {}", path, error);
|
||||
return error;
|
||||
}
|
||||
|
||||
while (di.has_next()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue