From 407aa14244f290b619b3077d8d1883dc82ba6405 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Fri, 29 Jun 2018 11:32:52 +0200 Subject: [PATCH] fix: catch file error in paste submission --- bin/submit_paste.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/submit_paste.py b/bin/submit_paste.py index 49c8e1f0..7417fa15 100755 --- a/bin/submit_paste.py +++ b/bin/submit_paste.py @@ -29,8 +29,12 @@ def create_paste(uuid, paste_content, ltags, ltagsgalaxies, name): addError(uuid, 'File: ' + save_path + ' already exist in submitted pastes') return 1 - gzipencoded = gzip.compress(paste_content) - gzip64encoded = base64.standard_b64encode(gzipencoded).decode() + try: + gzipencoded = gzip.compress(paste_content) + gzip64encoded = base64.standard_b64encode(gzipencoded).decode() + except: + abord_file_submission(uuid, "file error") + continue # send paste to Global module relay_message = "{0} {1}".format(save_path, gzip64encoded)