Skip to content

Commit

Permalink
Fixes #83. Parsing an invalid conandata.yml now shows the exception m…
Browse files Browse the repository at this point in the history
…essage to the user
  • Loading branch information
markfinal committed Jul 13, 2023
1 parent ca627af commit 7f37d4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cruiz/commands/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def get_conandata(
if self.parent():
self.parent().record_exception(exception)
else:
raise Exception(
raise ValueError(
"Failed to get conandata YAML dict for recipe"
) from exception
return conandata
Expand Down
7 changes: 6 additions & 1 deletion cruiz/load_recipe/loadrecipewizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ def __init__(
log_details.logging.connect(self._on_error_loading)
with managed_conan_context(DEFAULT_CACHE_NAME, log_details) as context:
self.recipe_attributes = context.inspect_recipe(self._path)
self.conandata = context.get_conandata(self._path)
try:
self.conandata = context.get_conandata(self._path)
except ValueError:
log_details.stderr(
"Unable to obtain version numbers from conandata.yml"
)

def _on_error_loading(self) -> None:
self.ui.intro_message.show()
Expand Down

0 comments on commit 7f37d4f

Please sign in to comment.