Skip to content

[Feature] Return parameter name on get_parameter exception #868

Description

@maxlein

Wouldn't it be a nice feature to return the missing parameter name instead of just throwing that some parameter is missing?

Something like this:

template<typename T>
   T get_parameter(const std::string & parameter_name)
   {
     auto error = fmt::format("Parameter {} not set!", parameter_name);
     return get_parameter_impl(
              parameter_name,
              std::function<T()>([&]() -> T {throw std::runtime_error( error.c_str() );}));
   }`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions