1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +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

@ -99,8 +99,9 @@ void FileSystemModel::Node::traverse_if_needed()
auto full_path = this->full_path();
Core::DirIterator di(full_path, m_model.should_show_dotfiles() ? Core::DirIterator::SkipParentAndBaseDir : Core::DirIterator::SkipDots);
if (di.has_error()) {
m_error = di.error();
warnln("DirIterator: {}", di.error_string());
auto error = di.error();
m_error = error.code();
warnln("DirIterator: {}", error);
return;
}