From ba58e374227d70e2e33ddfca1a5ba0d5e6661c00 Mon Sep 17 00:00:00 2001 From: EscapingGithub Date: Mon, 14 May 2018 00:51:52 -0700 Subject: [PATCH] Fix error handling --- steglsb.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/steglsb.py b/steglsb.py index 36c0ca5..0c0c0af 100755 --- a/steglsb.py +++ b/steglsb.py @@ -38,9 +38,10 @@ def _save_img(self, img, outfile): print('[!] {} image could not be written.'.format(outfile)) print('[!] {}'.format(e)) sys.exit() - except KeyError as e: - print('[!] Format unable to be determined by filename.'.format(outfile)) + except Exception as e: + print('[!] Unable to save file.') print('[!] {}'.format(e)) + sys.exit() class LSBEncode(LSB): def __init__(self, cover, secret, bits, outfile, mode=None):