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

HackStudio: Propagate error from TerminalWrapper

Use the ErrorOr pattern with the Core::System wrappers to propagate more
errors from the TerminalWrapper.

The run_command method, when called with WaitForExit::Yes now returns an
error on command failure.
This commit is contained in:
Lucas CHOLLET 2022-03-02 15:16:53 +01:00 committed by Andreas Kling
parent 5d29f64c99
commit 9a83d34543
4 changed files with 67 additions and 90 deletions

View file

@ -21,8 +21,8 @@ public:
No,
Yes
};
void run_command(const String&, Optional<String> working_directory = {}, WaitForExit = WaitForExit::No);
void kill_running_command();
ErrorOr<void> run_command(const String&, Optional<String> working_directory = {}, WaitForExit = WaitForExit::No, Optional<StringView> failure_message = {});
ErrorOr<void> kill_running_command();
void clear_including_history();
bool user_spawned() const { return m_user_spawned; }