diff --git a/platformio/project/config.py b/platformio/project/config.py index 2cb982fb..4e1a6673 100644 --- a/platformio/project/config.py +++ b/platformio/project/config.py @@ -324,6 +324,7 @@ class ProjectConfigBase: f"`${{this.__env__}}` is called from the `{parent_section}` " "section that is not valid PlatformIO environment, see", option, + " ", section, ) return parent_section[4:] @@ -332,7 +333,10 @@ class ProjectConfigBase: value = self.get(section, option) except RecursionError as exc: raise exception.ProjectOptionValueError( - "Infinite recursion has been detected", option, section + "Infinite recursion has been detected", + option, + " ", + section, ) from exc if isinstance(value, list): return "\n".join(value) @@ -359,7 +363,10 @@ class ProjectConfigBase: if not self.expand_interpolations: return value raise exception.ProjectOptionValueError( - exc.format_message(), option, section + exc.format_message(), + option, + " (%s) " % option_meta.description, + section, ) @staticmethod diff --git a/platformio/project/exception.py b/platformio/project/exception.py index d6e53fa6..91fc10bc 100644 --- a/platformio/project/exception.py +++ b/platformio/project/exception.py @@ -51,4 +51,4 @@ class InvalidEnvNameError(ProjectError): class ProjectOptionValueError(ProjectError): - MESSAGE = "{0} for option `{1}` in section [{2}]" + MESSAGE = "{0} for option `{1}`{2}in section [{3}]"