From 41e0c55d8f2f828be1747b95744b32daf2969cef Mon Sep 17 00:00:00 2001 From: ric-evans Date: Fri, 6 Dec 2024 15:51:19 -0600 Subject: [PATCH] comment - 3 --- rest_tools/server/arghandler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rest_tools/server/arghandler.py b/rest_tools/server/arghandler.py index fc5f9235..907a9bd6 100644 --- a/rest_tools/server/arghandler.py +++ b/rest_tools/server/arghandler.py @@ -62,7 +62,7 @@ def _universal_to_bool(val: Any) -> bool: INVALID_CHOICE_PATTERN = re.compile(r"(argument .+: invalid choice: .+)") # argument --reco_algo: cannot be empty string / whitespace -CATCH_MOST_PATTERN = re.compile(r"(argument .+: .+)") +FROM_ARGUMENT_TYPE_ERROR_PATTERN = re.compile(r"(argument .+: .+)") ############################################################################### @@ -213,9 +213,9 @@ def _translate_error( elif match := INVALID_CHOICE_PATTERN.search(err_msg): return match.group(1).replace("--", "") - # CATCH MOST (not quite 'catch all') -- covers errors in this known format + # argparse.ArgumentTypeError errors -- covers errors in this known format # -> this is matched when the server code raises argparse.ArgumentTypeError - elif match := CATCH_MOST_PATTERN.search(err_msg): + elif match := FROM_ARGUMENT_TYPE_ERROR_PATTERN.search(err_msg): return match.group(1).replace("--", "") # FALL-THROUGH -- log unknown exception