Skip to content

Commit

Permalink
added the message
Browse files Browse the repository at this point in the history
Signed-off-by: Jerry Guo <Jerry.Jinfeng.Guo@alliander.com>
  • Loading branch information
Jerry-Jinfeng-Guo committed Nov 26, 2024
1 parent 1e5bf19 commit edf220a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ class SparseMatrixError : public PowerGridError {

class NotObservableError : public PowerGridError {
public:
NotObservableError() { append_msg("Not enough measurements available for state estimation.\n"); }
NotObservableError(std::string const& msg = "") {
append_msg("Not enough measurements available for state estimation.\n");
if (!msg.empty()) {
append_msg(msg + "\n");
}
}
};

class IterationDiverge : public PowerGridError {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ inline void necessary_observability_check(MeasuredValues<sym> const& measured_va

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

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

0 comments on commit edf220a

Please sign in to comment.