mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 23:52:07 +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:
parent
5d29f64c99
commit
9a83d34543
4 changed files with 67 additions and 90 deletions
|
@ -1341,7 +1341,8 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_stop_action()
|
|||
{
|
||||
auto action = GUI::Action::create("&Stop", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/program-stop.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
if (!Debugger::the().session()) {
|
||||
m_terminal_wrapper->kill_running_command();
|
||||
if (auto result = m_terminal_wrapper->kill_running_command(); result.is_error())
|
||||
warnln("{}", result.error());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue