Skip to content

Commit c69a0cc

Browse files
committed
use explicit overload because otherwise the enum is not formatted correctly
Signed-off-by: Martijn Govers <[email protected]>
1 parent 0363510 commit c69a0cc

File tree

1 file changed

+1
-1
lines changed
  • power_grid_model_c/power_grid_model/include/power_grid_model/common

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class MissingCaseForEnumError : public InvalidArguments {
5959
template <typename T>
6060
requires std::is_enum_v<T>
6161
MissingCaseForEnumError(std::string_view method, T const& value)
62-
: MissingCaseForEnumError{method, std::to_underlying(value)} {}
62+
: InvalidArguments{method, std::format("{} #{:d}", typeid(T).name(), std::to_underlying(value))} {}
6363
};
6464

6565
class ConflictVoltage : public PowerGridError {

0 commit comments

Comments
 (0)