diff --git a/python/submit/submit.py b/python/submit/submit.py index 638af10..2f2a57b 100644 --- a/python/submit/submit.py +++ b/python/submit/submit.py @@ -39,7 +39,10 @@ def __str__(self) -> str: @classmethod def get_from_str(cls, value: str) -> ConvertMode: - return cls[value.upper()] + try: + return cls[value.upper()] + except KeyError: + raise argparse.ArgumentTypeError(f"无效的转换模式:{value}") @classmethod def get_available_values(cls) -> list[ConvertMode]: