Skip to content

Commit 145cd81

Browse files
committed
Streamline exception messages
1 parent 70d8394 commit 145cd81

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

embeddings/strategies/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ def __init_subclass__(cls, **kwargs: dict) -> None: # noqa: D105
3636

3737
# require class level STRATEGY_NAME to be set
3838
if not hasattr(cls, "STRATEGY_NAME"):
39-
msg = f"{cls.__name__} must define 'STRATEGY_NAME' class attribute"
40-
raise TypeError(msg)
39+
raise TypeError(f"{cls.__name__} must define 'STRATEGY_NAME' class attribute")
4140
if not isinstance(cls.STRATEGY_NAME, str):
42-
msg = f"{cls.__name__} must override 'STRATEGY_NAME' with a valid string"
43-
raise TypeError(msg)
41+
raise TypeError(
42+
f"{cls.__name__} must override 'STRATEGY_NAME' with a valid string"
43+
)
4444

4545
@abstractmethod
4646
def extract_text(self) -> str:

0 commit comments

Comments
 (0)