refactor: one refusal path to stderr and events

Library functions printed their refusal and exited, each deciding on its
own whether --events got an error event. --cores-dir, --installed-cores
with no core, a list without system_cores or standalone_builds, a pack
that cannot be used, a board list a run needs and --dest alone beside
two setups ended on code 1 with no reason in the stream.

They now raise Refusal (installer/refusal.py), carrying the stage, the
reason, the platform, the lines and the code. The install, an action
framed by events and main report it once: the error event, then the
same lines on stderr, so the text and exit codes stay as they were.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 19:50:46 +01:00
1 parent ced68a9135
commit eba627aa89
20 files changed
+542 -402

No files matched your search

+1 -1
View File
@@ -1390,7 +1390,7 @@ class ADetectedClosedFolderSaysWhereItCameFrom(unittest.TestCase):
def test_an_assumed_default_reads_plainly(self):
self.assertIn("used by default, since {display_name(name)} was not found",
_source_of(install._install))
_source_of(install._install_run))
class OfflineWithNothingFound(unittest.TestCase):