Skip to content

Commit

Permalink
throw error if unable to write json variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jbbjarnason committed Jun 26, 2024
1 parent 09920f7 commit ca3c887
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libs/ipc/inc/public/tfc/ipc/details/dbus_server_iface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class ipc_manager_server {
auto const write{ glz::write_json(ipc_manager_->get_all_signals()) };
if (!write) {
fmt::println(stderr, "Failed to write signals to json: {}", format_error(write.error()));
return std::string{};
throw dbus_error("Failed to write signals to json");
}
return write.value();
});
Expand All @@ -295,8 +295,8 @@ class ipc_manager_server {
std::string(consts::slots_property), sdbusplus::vtable::property_::emits_change, [&](const auto&) {
auto const write{ glz::write_json(ipc_manager_->get_all_slots()) };
if (!write) {
fmt::println(stderr, "Failed to write signals to json: {}", format_error(write.error()));
return std::string{};
fmt::println(stderr, "Failed to write slots to json: {}", format_error(write.error()));
throw dbus_error("Failed to write slots to json");
}
return write.value();
});
Expand All @@ -305,8 +305,8 @@ class ipc_manager_server {
std::string(consts::connections_property), sdbusplus::vtable::property_::emits_change, [&](const auto&) {
auto const write{ glz::write_json(ipc_manager_->get_all_connections()) };
if (!write) {
fmt::println(stderr, "Failed to write signals to json: {}", format_error(write.error()));
return std::string{};
fmt::println(stderr, "Failed to write connections to json: {}", format_error(write.error()));
throw dbus_error("Failed to write connections to json");
}
return write.value();
});
Expand Down

0 comments on commit ca3c887

Please sign in to comment.