Skip to content

Commit edf220a

Browse files
added the message
Signed-off-by: Jerry Guo <Jerry.Jinfeng.Guo@alliander.com>
1 parent 1e5bf19 commit edf220a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

power_grid_model_c/power_grid_model/include/power_grid_model/common/exception.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,12 @@ class SparseMatrixError : public PowerGridError {
112112

113113
class NotObservableError : public PowerGridError {
114114
public:
115-
NotObservableError() { append_msg("Not enough measurements available for state estimation.\n"); }
115+
NotObservableError(std::string const& msg = "") {
116+
append_msg("Not enough measurements available for state estimation.\n");
117+
if (!msg.empty()) {
118+
append_msg(msg + "\n");
119+
}
120+
}
116121
};
117122

118123
class IterationDiverge : public PowerGridError {

power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/observability.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ inline void necessary_observability_check(MeasuredValues<sym> const& measured_va
6868

6969
auto const [n_voltage_sensor, n_voltage_phasor_sensor] = detail::count_voltage_sensors(n_bus, measured_values);
7070
if (n_voltage_sensor < 1) {
71-
throw NotObservableError{};
71+
throw NotObservableError{"no voltage sensor found"};
7272
}
7373

7474
Idx const n_injection_sensor = detail::count_bus_injection_sensors(n_bus, measured_values);

0 commit comments

Comments
 (0)