raise VMError on invalid kind

This commit is contained in:
onyx-and-iris 2023-06-23 03:43:34 +01:00
parent 6c4259d6de
commit 064cfeb23d

View File

@ -1,6 +1,8 @@
from dataclasses import dataclass from dataclasses import dataclass
from enum import Enum, unique from enum import Enum, unique
from .error import VMError
@unique @unique
class KindId(Enum): class KindId(Enum):
@ -105,7 +107,7 @@ def request_kind_map(kind_id):
try: try:
KIND_obj = kind_factory(kind_id) KIND_obj = kind_factory(kind_id)
except ValueError as e: except ValueError as e:
print(e) raise VMError(str(e)) from e
return KIND_obj return KIND_obj