Skip to content

Commit

Permalink
manifest: handle missing top level manifest file
Browse files Browse the repository at this point in the history
Improve error handling to avoid dumping stack.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
  • Loading branch information
mbolivar-nordic committed May 18, 2023
1 parent 3463028 commit b4c8ba0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/west/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,15 @@ def get_option(option, default=None):

current_relpath = manifest_path / manifest_file
current_abspath = topdir_abspath / current_relpath
current_data = current_abspath.read_text(encoding='utf-8')
try:
current_data = current_abspath.read_text(encoding='utf-8')
except FileNotFoundError:
raise MalformedConfig(
f'file not found: manifest file {current_abspath} '
'(from configuration options '
f'manifest.path="{manifest_path_option}", '
f'manifest.file="{manifest_file}")')

current_repo_abspath = topdir_abspath / manifest_path

self.abspath = os.fspath(current_abspath)
Expand Down

0 comments on commit b4c8ba0

Please sign in to comment.