neighbor/Plugin: migrate from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-09-05 10:53:54 +02:00
parent 135662d6b0
commit 871063dab7
8 changed files with 40 additions and 67 deletions

View File

@@ -24,7 +24,6 @@
#include "neighbor/Glue.hxx"
#include "fs/Path.hxx"
#include "event/Loop.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
#include <stdio.h>
@@ -56,8 +55,6 @@ try {
/* read configuration file (mpd.conf) */
Error error;
config_global_init();
ReadConfigFile(config_path);
@@ -69,17 +66,15 @@ try {
MyNeighborListener listener;
NeighborGlue neighbor;
if (!neighbor.Init(loop, listener, error) || !neighbor.Open(error)) {
LogError(error);
return EXIT_FAILURE;
}
neighbor.Init(loop, listener);
neighbor.Open();
/* run */
loop.Run();
neighbor.Close();
return EXIT_SUCCESS;
} catch (const std::exception &e) {
} catch (const std::exception &e) {
LogError(e);
return EXIT_FAILURE;
}
}