mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
FileManager: Display message box if stat()'ing a file to activate fails
This commit is contained in:
parent
569a035786
commit
b409d3cf88
Notes:
sideshowbarker
2024-07-17 03:18:29 +09:00
Author: https://github.com/sppmacd Commit: https://github.com/SerenityOS/serenity/commit/b409d3cf88 Pull-request: https://github.com/SerenityOS/serenity/pull/16493
1 changed files with 2 additions and 0 deletions
|
@ -102,6 +102,8 @@ void DirectoryView::handle_activation(GUI::ModelIndex const& index)
|
|||
struct stat st;
|
||||
if (stat(path.characters(), &st) < 0) {
|
||||
perror("stat");
|
||||
auto error_message = DeprecatedString::formatted("Could not stat {}: {}", path, strerror(errno));
|
||||
GUI::MessageBox::show(window(), error_message, "File Manager"sv, GUI::MessageBox::Type::Error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue