diff --git a/Userland/Utilities/cpp-lexer.cpp b/Userland/Utilities/cpp-lexer.cpp index 4b713f6217..528f231405 100644 --- a/Userland/Utilities/cpp-lexer.cpp +++ b/Userland/Utilities/cpp-lexer.cpp @@ -17,7 +17,7 @@ int main(int argc, char** argv) auto file = Core::File::construct(path); if (!file->open(Core::OpenMode::ReadOnly)) { - perror("open"); + warnln("Failed to open {}: {}", path, file->error_string()); exit(1); } auto content = file->read_all(); diff --git a/Userland/Utilities/cpp-parser.cpp b/Userland/Utilities/cpp-parser.cpp index 5ce02563cf..89ca66d8b6 100644 --- a/Userland/Utilities/cpp-parser.cpp +++ b/Userland/Utilities/cpp-parser.cpp @@ -21,7 +21,7 @@ int main(int argc, char** argv) path = "Source/little/main.cpp"; auto file = Core::File::construct(path); if (!file->open(Core::OpenMode::ReadOnly)) { - perror("open"); + warnln("Failed to open {}: {}", path, file->error_string()); exit(1); } auto content = file->read_all(); diff --git a/Userland/Utilities/cpp-preprocessor.cpp b/Userland/Utilities/cpp-preprocessor.cpp index e8f185cf37..2266315359 100644 --- a/Userland/Utilities/cpp-preprocessor.cpp +++ b/Userland/Utilities/cpp-preprocessor.cpp @@ -19,7 +19,7 @@ int main(int argc, char** argv) args_parser.parse(argc, argv); auto file = Core::File::construct(path); if (!file->open(Core::OpenMode::ReadOnly)) { - perror("open"); + warnln("Failed to open {}: {}", path, file->error_string()); exit(1); } auto content = file->read_all();