Improve how errors are raised before the dispatcher is created
mr-cal opened this issue · comments
Callahan commented
What needs to get done
Add a pre-craft-cli error handler or move the validation to after the dispatcher is created.
Why it needs to get done
There are a few errors that can get raised in _get_dispatcher
before the dispatcher is created:
These errors create tracebacks that do not look good for end users:
Traceback (most recent call last):
File "/home/developer/dev/snapcraft/venv/bin/snapcraft", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/developer/dev/snapcraft/snapcraft/application.py", line 351, in main
return app.run()
^^^^^^^^^
File "/home/developer/dev/snapcraft/snapcraft/application.py", line 179, in run
return_code = super().run()
^^^^^^^^^^^^^
File "/home/developer/dev/snapcraft/venv/lib/python3.12/site-packages/craft_application/application.py", line 492, in run
dispatcher = self._get_dispatcher()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/developer/dev/snapcraft/snapcraft/application.py", line 260, in _get_dispatcher
_get_esm_error_for_base(base)
File "/home/developer/dev/snapcraft/snapcraft/application.py", line 79, in _get_esm_error_for_base
raise RuntimeError(
RuntimeError: ERROR: base 'core18' was last supported on Snapcraft 7 available on the '7.x' channel.
syncronize-issues-to-jira commented
Thank you for reporting us your feedback!
The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3102.
This message was autogenerated