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

This commit is contained in:
Max Kellermann
2016-10-28 23:03:07 +02:00
parent 7e5ce623fe
commit dea46e8d5a
7 changed files with 31 additions and 61 deletions

View File

@@ -127,13 +127,7 @@ try {
if (path != nullptr)
block.AddBlockParam("path", path->value.c_str(), path->line);
Database *db = plugin->create(event_loop, database_listener,
block, error);
if (db == nullptr) {
cerr << error.GetMessage() << endl;
return EXIT_FAILURE;
}
Database *db = plugin->create(event_loop, database_listener, block);
AtScopeExit(db) { delete db; };