summaryrefslogtreecommitdiff
path: root/Userland/Shell/Shell.cpp
diff options
context:
space:
mode:
authorCameron Youell <cameronyouell@gmail.com>2023-04-17 16:02:41 +1000
committerAndreas Kling <kling@serenityos.org>2023-04-24 09:21:51 +0200
commitda305017dec62c734ae2abc50243a25e6c13874d (patch)
treed2161eb8e674193b5c104cf4f70e183c62a53cfd /Userland/Shell/Shell.cpp
parentba38984a6031aa1dd6fa6bfe931c346a8971ce92 (diff)
downloadserenity-da305017dec62c734ae2abc50243a25e6c13874d.zip
Shell: Use `JsonArray::append` in `save_to`
We can convert it into a failable function here easily
Diffstat (limited to 'Userland/Shell/Shell.cpp')
-rw-r--r--Userland/Shell/Shell.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp
index f5acf281be..4d27ea2775 100644
--- a/Userland/Shell/Shell.cpp
+++ b/Userland/Shell/Shell.cpp
@@ -2348,7 +2348,7 @@ void Shell::kill_job(Job const* job, int sig)
}
}
-void Shell::save_to(JsonObject& object)
+ErrorOr<void> Shell::save_to(JsonObject& object)
{
Core::Object::save_to(object);
object.set("working_directory", cwd);
@@ -2367,9 +2367,11 @@ void Shell::save_to(JsonObject& object)
job_object.set("running_time", job_entry.value->timer().elapsed());
job_object.set("command", job_entry.value->cmd());
job_object.set("is_running_in_background", job_entry.value->is_running_in_background());
- job_objects.must_append(move(job_object));
+ TRY(job_objects.append(move(job_object)));
}
object.set("jobs", move(job_objects));
+
+ return {};
}
void Shell::possibly_print_error() const