mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
move parser_name to except block
This commit is contained in:
@ -136,11 +136,11 @@ def main():
|
|||||||
for arg in sys.argv:
|
for arg in sys.argv:
|
||||||
if arg in parser_map:
|
if arg in parser_map:
|
||||||
try:
|
try:
|
||||||
parser_name = arg.lstrip('--')
|
|
||||||
result = parser_map[arg](data, raw=raw, quiet=quiet)
|
result = parser_map[arg](data, raw=raw, quiet=quiet)
|
||||||
found = True
|
found = True
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
|
parser_name = arg.lstrip('--')
|
||||||
jc.utils.error_message(f'{parser_name} parser could not parse the input data. Did you use the correct parser?\n For details use the -d option.')
|
jc.utils.error_message(f'{parser_name} parser could not parse the input data. Did you use the correct parser?\n For details use the -d option.')
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user