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

[ONNX] Refactor exceptions (#1467)

parent 31ee5658
...@@ -24,29 +24,28 @@ namespace ngraph ...@@ -24,29 +24,28 @@ namespace ngraph
{ {
namespace error namespace error
{ {
struct not_supported_error : ngraph_error struct NotSupported : ngraph_error
{ {
explicit not_supported_error(const std::string& op_name, explicit NotSupported(const std::string& op_name,
const std::string& name, const std::string& name,
const std::string& message) const std::string& message)
: ngraph_error{op_name + " node (" + name + "): " + message} : ngraph_error{op_name + " node (" + name + "): " + message}
{ {
} }
}; };
namespace op namespace parameter
{ {
struct op_value_error : ngraph_error struct Value : ngraph_error
{ {
explicit op_value_error(const std::string& op_name, Value(const std::string& op_name,
const std::string& name, const std::string& name,
const std::string& message) const std::string& message)
: ngraph_error{op_name + " node (" + name + "): " + message} : ngraph_error{op_name + " node (" + name + "): " + message}
{ {
} }
}; };
} // namespace paramter
} // namespace op
} // namespace error } // namespace error
......
...@@ -48,15 +48,15 @@ namespace ngraph ...@@ -48,15 +48,15 @@ namespace ngraph
if (!is_test) if (!is_test)
{ {
throw error::not_supported_error("BatchNormalization", throw error::NotSupported("BatchNormalization",
node.get_name(), node.get_name(),
"only 'is_test' mode is currently supported."); "only 'is_test' mode is currently supported.");
} }
if (!spatial) if (!spatial)
{ {
throw error::not_supported_error("BatchNormalization", throw error::NotSupported("BatchNormalization",
node.get_name(), node.get_name(),
"only 'spatial' mode is currently supported."); "only 'spatial' mode is currently supported.");
} }
if (inputs.size() >= 5) if (inputs.size() >= 5)
......
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