We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ac8edf4 + de534eb commit 33feac8Copy full SHA for 33feac8
1 file changed
src/polycubed/src/cube.cpp
@@ -117,9 +117,14 @@ std::shared_ptr<PortIface> Cube::add_port(const std::string &name,
117
118
// TODO: is this valid?
119
cube_mutex_.unlock();
120
-
121
- if (conf.count("peer")) {
122
- port->set_peer(conf.at("peer").get<std::string>());
+ try {
+ if (conf.count("peer")) {
+ port->set_peer(conf.at("peer").get<std::string>());
123
+ }
124
+ } catch(...) {
125
+ ports_by_name_.erase(name);
126
+ ports_by_index_.erase(id);
127
+ throw;
128
}
129
130
return std::move(port);
0 commit comments