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