1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:27:35 +00:00

FileManager: Use TRY in run_file_operation()

The exception is `execvp()` since that has no Core::System wrapper yet.
This commit is contained in:
Sam Atkins 2022-03-12 12:44:37 +00:00 committed by Andreas Kling
parent 6a23dfbc92
commit dc5a318aa9
4 changed files with 23 additions and 34 deletions

View file

@ -176,8 +176,10 @@ void do_paste(String const& target_directory, GUI::Window* window)
source_paths.append(url.path());
}
if (!source_paths.is_empty())
run_file_operation(file_operation, source_paths, target_directory, window);
if (!source_paths.is_empty()) {
if (auto result = run_file_operation(file_operation, source_paths, target_directory, window); result.is_error())
dbgln("Failed to paste files: {}", result.error());
}
}
void do_create_link(Vector<String> const& selected_file_paths, GUI::Window* window)