aboutsummaryrefslogtreecommitdiff
path: root/tools/cru-py/cru/_base.py
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2024-11-11 01:12:29 +0800
committerYuqian Yang <crupest@crupest.life>2025-01-16 21:14:14 +0800
commitc0ba4d9d8d19d3faa7b4d2b3509546e37dd32364 (patch)
tree4b3d969850981094ba33e18ac9ec49fbc409dc93 /tools/cru-py/cru/_base.py
parent7f2e4107e7f469d6747350487e9441d9b987de47 (diff)
downloadcrupest-c0ba4d9d8d19d3faa7b4d2b3509546e37dd32364.tar.gz
crupest-c0ba4d9d8d19d3faa7b4d2b3509546e37dd32364.tar.bz2
crupest-c0ba4d9d8d19d3faa7b4d2b3509546e37dd32364.zip
HALF WORK: 2024.1.16
Diffstat (limited to 'tools/cru-py/cru/_base.py')
-rw-r--r--tools/cru-py/cru/_base.py6
1 files changed, 3 insertions, 3 deletions
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