Function email::utils::get_env_var_or_default

Function Documentation

std::string email::utils::get_env_var_or_default(const std::string &env_var, const std::string &default_value)

Get an environment variable value or a default value.

The default value is used if the value is not found or if it is the empty string. TODO(christophebedard) use rcutils_get_env() directly to tell between unset and empty?

Parameters:
  • env_var – the environment variable name

  • default_value – the default value to use if not found

Throws:

std::runtime_error – on error

Returns:

the value or default value