fix: catch file error in paste submission

This commit is contained in:
Terrtia 2018-06-29 11:32:52 +02:00
parent 5908710b34
commit 407aa14244
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -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)