This PR fixes a bug in the ProxyManager::getProxy method. Because ProxyManager::getProxy uses operator[] to lookup IDs in the map, if the ID is not a key already, it will be added to the map. To fix this bug, we should find instead of operator[].
I also changed ProxyManager::getProxy to return a libmexclass::proxy::ProxyResult, which is a typedef to std::variant<std::shared_ptr<Proxy>, libmexclass::error::Error>.
This PR fixes a bug in the
ProxyManager::getProxy
method. BecauseProxyManager::getProxy
usesoperator[]
to lookup IDs in the map, if the ID is not a key already, it will be added to the map. To fix this bug, we shouldfind
instead ofoperator[]
.I also changed
ProxyManager::getProxy
to return alibmexclass::proxy::ProxyResult
, which is atypedef
tostd::variant<std::shared_ptr<Proxy>, libmexclass::error::Error>
.