Commit 7f4679ab authored by Jakob Otto's avatar Jakob Otto

Add missing error handling

parent 857f4a0f
......@@ -129,12 +129,14 @@ public:
}
template <class Parent>
void add_new_worker(Parent& parent, node_id node, id_type id) {
error add_new_worker(Parent& parent, node_id node, id_type id) {
auto application = factory_.make();
auto worker = std::make_shared<worker_type>(std::move(application), id);
worker->init(parent);
if (auto err = worker->init(parent))
return err;
workers_by_id_.emplace(std::move(id), worker);
workers_by_node_.emplace(std::move(node), std::move(worker));
return none;
}
private:
......
......@@ -196,7 +196,8 @@ struct fixture : host_fixture {
void add_new_workers() {
for (auto& data : test_data) {
dispatcher.add_new_worker(dummy, data.nid, data.ep);
if (auto err = dispatcher.add_new_worker(dummy, data.nid, data.ep))
CAF_FAIL("add_new_worker returned an error: " << err);
}
buf->clear();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment