From 480849640ea2f3f3760b2cf86a91b00031538d6d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 19 Jul 2022 10:16:18 -0400 Subject: [PATCH] Make error message more clear --- confluent_client/confluent/logreader.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/confluent_client/confluent/logreader.py b/confluent_client/confluent/logreader.py index 94034d06..5bb14892 100644 --- a/confluent_client/confluent/logreader.py +++ b/confluent_client/confluent/logreader.py @@ -282,14 +282,19 @@ def _replay_to_console(txtfile, binfile): def replay_to_console(txtfile): if os.path.exists(txtfile + '.cbl'): binfile = txtfile + '.cbl' + elif '.' not in txtfile: + if '/' not in txtfile: + txtfile = os.getcwd() + '/' + txtfile + sys.stderr.write('Unable to locate cbl file: "{0}"\n'.format(txtfile + '.cbl')) + sys.exit(1) else: fileparts = txtfile.split('.') prefix = '.'.join(fileparts[:-1]) binfile = prefix + '.cbl.' + fileparts[-1] if not os.path.exists(binfile): - sys.stderr.write('Unable to locate cbl file\n') + sys.stderr.write('Unable to locate cbl file: "{0}"\n'.format(binfile)) sys.exit(1) _replay_to_console(txtfile, binfile) if __name__ == '__main__': - replay_to_console(sys.argv[1]) \ No newline at end of file + replay_to_console(sys.argv[1])