We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16ea1e3 commit 1d6d133Copy full SHA for 1d6d133
power_grid_model_c/power_grid_model_cpp/include/power_grid_model_cpp/dataset.hpp
@@ -13,6 +13,15 @@
13
#include "power_grid_model_c/dataset.h"
14
15
namespace power_grid_model_cpp {
16
+class ComponentTypeNotFound : public PowerGridError {
17
+ public:
18
+ ComponentTypeNotFound(std::string const& component)
19
+ : PowerGridError{[&]() {
20
+ using namespace std::string_literals;
21
+ return "ComponentType"s + component + " not found"s;
22
+ }()} {}
23
+ ComponentTypeNotFound(std::string_view component) : ComponentTypeNotFound{std::string{component}} {}
24
+};
25
26
class DatasetInfo {
27
@@ -51,7 +60,7 @@ class DatasetInfo {
51
60
return idx;
52
61
}
53
62
54
- return -1;
63
+ throw ComponentTypeNotFound{component};
55
64
56
65
57
66
private:
0 commit comments