zeroconf/Glue: allow ZeroconfInit() to throw

This commit is contained in:
Max Kellermann 2021-02-24 14:14:04 +01:00
parent 06b9bdba2c
commit fe741bd767
2 changed files with 9 additions and 1 deletions

View File

@ -476,7 +476,12 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
};
#endif
ZeroconfInit(raw_config, instance.event_loop);
try {
ZeroconfInit(raw_config, instance.event_loop);
} catch (...) {
LogError(std::current_exception(),
"Zeroconf initialization failed");
}
#ifdef ENABLE_DATABASE
if (create_db) {

View File

@ -27,6 +27,9 @@ class EventLoop;
#ifdef HAVE_ZEROCONF
/**
* Throws on error.
*/
void
ZeroconfInit(const ConfigData &config, EventLoop &loop);