cli/templates: only catch ClanError

This commit is contained in:
Michael Hoang
2025-09-16 14:06:14 +02:00
parent c249994e18
commit 19a209c75a

View File

@@ -2,6 +2,7 @@ import logging
from dataclasses import dataclass from dataclasses import dataclass
from clan_lib.dirs import clan_templates from clan_lib.dirs import clan_templates
from clan_lib.errors import ClanError
from clan_lib.flake import Flake from clan_lib.flake import Flake
from clan_lib.nix_models.clan import ClanTemplatesType from clan_lib.nix_models.clan import ClanTemplatesType
@@ -35,8 +36,7 @@ def list_templates(flake: Flake | None) -> TemplateList:
builtin_templates = flake.select("clanInternals.templates") builtin_templates = flake.select("clanInternals.templates")
return TemplateList(builtin_templates, custom_templates) return TemplateList(builtin_templates, custom_templates)
except ClanError:
except (AttributeError, KeyError, Exception):
log.debug( log.debug(
"Failed to get templates from clan inputs, " "Failed to get templates from clan inputs, "
"falling back to clan-core builtin templates", "falling back to clan-core builtin templates",