Exit cleanly on avahi error

This commit is contained in:
Patrick Nicolas
2023-10-17 11:17:47 +02:00
parent c0e8a030ca
commit 210baa258f
2 changed files with 10 additions and 3 deletions
+4 -3
View File
@@ -23,9 +23,10 @@ void avahi_publisher::create_service(AvahiClient * client)
entry_group = avahi_entry_group_new(client, avahi_entry_group_callback, nullptr);
if (!entry_group)
{
std::cerr << "Cannot create entry group, you may need to remove disable-user-service-publishing from your avahi daemon config: "
<< avahi_strerror(avahi_client_errno(client)) << std::endl;
abort();
throw std::runtime_error(
std::string(
"Cannot create entry group, you may need to remove disable-user-service-publishing from your avahi daemon config: ") +
avahi_strerror(avahi_client_errno(client)));
}
}
avahi_entry_group_reset(entry_group);