Commit e81d30f1 authored by Michał Karzyński's avatar Michał Karzyński Committed by Robert Kimball

[ONNX] Ops bridge - change exception handling (#1485)

parent cb4c2c5d
......@@ -79,14 +79,14 @@ namespace ngraph
NodeVector operator()(const Node& node) const
{
try
{
return m_map.at(node.op_type())(node);
}
catch (const std::out_of_range&)
auto it = m_map.find(node.op_type());
if (it == m_map.end())
{
throw detail::error::unknown_operation{node.op_type()};
}
std::function<NodeVector(const Node&)> factory{it->second};
return factory(node);
}
};
......
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