From c0ba4d9d8d19d3faa7b4d2b3509546e37dd32364 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 11 Nov 2024 01:12:29 +0800 Subject: HALF WORK: 2024.1.16 --- tools/cru-py/cru/_base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/cru-py/cru/_base.py') diff --git a/tools/cru-py/cru/_base.py b/tools/cru-py/cru/_base.py index 0a22df4..2599d8f 100644 --- a/tools/cru-py/cru/_base.py +++ b/tools/cru-py/cru/_base.py @@ -1,10 +1,10 @@ from typing import Any from ._helper import remove_none -from ._error import CruInternalError +from ._error import CruException -class CruNamespaceError(CruInternalError): +class CruNamespaceError(CruException): """Raised when a namespace is not found.""" @@ -41,7 +41,7 @@ class _Cru: def check_name_format(name: str) -> tuple[str, str]: no_prefix_name = _Cru._maybe_remove_prefix(name) if no_prefix_name is None: - raise ValueError( + raise CruNamespaceError( f"Name {name} is not prefixed with any of {_Cru.NAME_PREFIXES}." ) return name, no_prefix_name -- cgit v1.2.3