From 6acfe47b83ebf6f61eae17552fe46da7c09737c6 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Sun, 4 Jan 2026 22:19:36 -0600 Subject: [PATCH] mergerfs_webui.cpp --- src/mergerfs_webui.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mergerfs_webui.cpp b/src/mergerfs_webui.cpp index c12f997b..b3bbd872 100644 --- a/src/mergerfs_webui.cpp +++ b/src/mergerfs_webui.cpp @@ -316,17 +316,18 @@ _post_kvs_key(const httplib::Request &req_, j = json::parse(req_.body); rv = mergerfs::api::set_kv(mount,key,(std::string)j); + + j = json::object(); if(rv < 0) { - j = json::object(); + j["error"] = strerror(-rv); + res_.status = 400; } - else - { - j = json::object(); - res_.set_content(j.dump(), - "application/json"); - } + + res_.set_content(j.dump(), + "application/json"); + } catch (const std::exception& e) {