From f6c6fc13ac4c779667807df12444a41ef28a8011 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 13 Sep 2021 08:55:19 -0700 Subject: [PATCH] enhance error msg when streaming parser is used --- jc/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jc/cli.py b/jc/cli.py index 2dd4ded6..3f5d2446 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -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))