Small change in error catching in validate function
This commit is contained in:
parent
b6f9c992f5
commit
5f3fe03108
@ -65,12 +65,12 @@ def check_exists_ask_overwrite(arg_value:str) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
def validate_all_args(parsed_args:dict) -> None:
|
def validate_all_args(parsed_args:dict) -> None:
|
||||||
# Raises ArgumentError if any of the arguments is not validated
|
# Raises AssertionError if any of the arguments is not validated
|
||||||
try:
|
try:
|
||||||
for arg_name, arg_value in parsed_args.items():
|
for arg_name, arg_value in parsed_args.items():
|
||||||
if not is_argument_valid(arg_name, arg_value):
|
if not is_argument_valid(arg_name, arg_value):
|
||||||
raise argparse.ArgumentError
|
raise AssertionError
|
||||||
except argparse.ArgumentError as e:
|
except AssertionError as e:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
f'The specified {arg_name} "{arg_value}" is not valid.') from e
|
f'The specified {arg_name} "{arg_value}" is not valid.') from e
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user