1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-17 01:32:37 +02:00

enhance error msg when streaming parser is used

This commit is contained in:
Kelly Brazil
2021-09-13 08:55:19 -07:00
parent 1d8cfae89f
commit f6c6fc13ac

View File

@ -663,8 +663,13 @@ def main():
if debug:
raise
else:
streaming_msg = ''
if getattr(parser.info, 'streaming', None):
streaming_msg = ' Try the quiet option (-q) to ignore errors.\n'
jc.utils.error_message(
f'{parser_name} parser could not parse the input data. Did you use the correct parser?\n'
f'{streaming_msg}'
' For details use the -d or -dd option. Use "jc -h" for help.')
sys.exit(combined_exit_code(magic_exit_code, JC_ERROR_EXIT))