main: update ManifestImportFailed error handling

Commit 2327610945
("manifest: ManifestImportFailed: relax argument specification")
changed the attributes in ManifestImportFailed instances, but the
corresponding error handling code in main.py was not updated.

This is incorrect and results in an ugly traceback instead of a
properly formatted error message.

Restore the preferred behavior by using the new attribute 'imp'.

Fixes: #588

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2022-07-14 13:06:55 -07:00 committed by Marti Bolivar
parent c17e0b27a7
commit a9ce810ac9
1 changed files with 3 additions and 3 deletions

View File

@ -192,8 +192,8 @@ class WestApp:
if args.command == 'update': if args.command == 'update':
return # that's fine return # that's fine
p, f = self.mle.project, self.mle.filename p, imp = self.mle.project, self.mle.imp
ctxt = f' Missing file: "{f}"' ctxt = f' Failed importing "{imp}"'
if not isinstance(p, ManifestProject): if not isinstance(p, ManifestProject):
# Try to be more helpful by explaining exactly # Try to be more helpful by explaining exactly
# what west.manifest needs to happen before we can # what west.manifest needs to happen before we can
@ -204,7 +204,7 @@ class WestApp:
ctxt += ' Hint: for this to work:\n' ctxt += ' Hint: for this to work:\n'
ctxt += f' - {p.name} must be cloned\n' ctxt += f' - {p.name} must be cloned\n'
ctxt += (f' - its {MANIFEST_REV_BRANCH} ref ' ctxt += (f' - its {MANIFEST_REV_BRANCH} ref '
'must point to a commit with the missing file\n') 'must point to a commit with the import data\n')
ctxt += ' To fix, run:\n' ctxt += ' To fix, run:\n'
ctxt += ' west update' ctxt += ' west update'