summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorcreator1creeper1 <creator1creeper1@airmail.cc>2021-12-25 16:27:27 +0100
committerAndreas Kling <kling@serenityos.org>2021-12-30 14:37:02 +0100
commitbceddb20739f5175e7b1220cd29855056d8aee89 (patch)
tree0813430ab173701d2fddbdfe70695c28076509a9 /Userland/Utilities
parent904c8634eb9d7048690caf3b5529fc16ddc0f07d (diff)
downloadserenity-bceddb20739f5175e7b1220cd29855056d8aee89.zip
Utilities/mount: Propagate errors in JSON decoding
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/mount.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Utilities/mount.cpp b/Userland/Utilities/mount.cpp
index 118b4941af..05c61de297 100644
--- a/Userland/Utilities/mount.cpp
+++ b/Userland/Utilities/mount.cpp
@@ -124,7 +124,12 @@ static bool print_mounts()
}
auto content = df->read_all();
- auto json = JsonValue::from_string(content).release_value_but_fixme_should_propagate_errors();
+ auto json_or_error = JsonValue::from_string(content);
+ if (json_or_error.is_error()) {
+ warnln("Failed to decode JSON: {}", json_or_error.error());
+ return false;
+ }
+ auto json = json_or_error.release_value();
json.as_array().for_each([](auto& value) {
auto& fs_object = value.as_object();