except.hpp
1 //*****************************************************************************
2 // Copyright 2017-2021 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //*****************************************************************************
16 
17 #pragma once
18 
19 #include <sstream>
20 #include <stdexcept>
21 
22 #include <ngraph/ngraph_visibility.hpp>
23 
24 namespace ngraph
25 {
26  /// Base error for ngraph runtime errors.
27  class NGRAPH_API ngraph_error : public std::runtime_error
28  {
29  public:
30  explicit ngraph_error(const std::string& what_arg)
31  : std::runtime_error(what_arg)
32  {
33  }
34 
35  explicit ngraph_error(const char* what_arg)
36  : std::runtime_error(what_arg)
37  {
38  }
39 
40  explicit ngraph_error(const std::stringstream& what_arg)
41  : std::runtime_error(what_arg.str())
42  {
43  }
44  };
45 
46  class NGRAPH_API unsupported_op : public std::runtime_error
47  {
48  public:
49  unsupported_op(const std::string& what_arg)
50  : std::runtime_error(what_arg)
51  {
52  }
53  };
54 }
Base error for ngraph runtime errors.
Definition: except.hpp:28
Definition: except.hpp:47
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28