flake.py: Don't hide error messages

This commit is contained in:
Qubasa
2025-08-12 14:18:19 +07:00
parent 073027f7c6
commit 0904c9da60

View File

@@ -907,7 +907,18 @@ class Flake:
).stdout.strip()
)
except ClanCmdError as e:
raise ClanSelectError(flake_identifier=self.identifier, selectors=selectors, cmd_error=e) from e
if "error: attribute" in str(e):
# If the error is about a missing attribute, we raise a ClanSelectError
# with the failed selectors and the flake identifier.
raise ClanSelectError(
flake_identifier=self.identifier,
selectors=selectors,
cmd_error=e,
) from e
# If the error is not about a missing attribute, we re-raise it as a ClanCmdError
# to preserve the original error context.
raise
if tmp_store := nix_test_store():
build_output = tmp_store.joinpath(*build_output.parts[1:])