summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Buquet <pep@bouah.net>2020-05-12 02:02:38 +0200
committerMaxime Buquet <pep@bouah.net>2020-05-12 02:02:38 +0200
commit1b974d2d9aec5c20d3111d208a24d7d67ab6b7de (patch)
tree15ac7daaafd31f3d5502d009960e1117fb6cc802
parentac3fb695741a638d25d0731ef7f037852f0a641d (diff)
parent8b385a0c99f0f4c184c096ba8f01900578b1b1d7 (diff)
downloadpoezio-1b974d2d9aec5c20d3111d208a24d7d67ab6b7de.tar.gz
poezio-1b974d2d9aec5c20d3111d208a24d7d67ab6b7de.tar.bz2
poezio-1b974d2d9aec5c20d3111d208a24d7d67ab6b7de.tar.xz
poezio-1b974d2d9aec5c20d3111d208a24d7d67ab6b7de.zip
Merge branch 'upload-exceptions' into 'master'
plugins/upload: handle more exceptions See merge request poezio/poezio!97
-rw-r--r--plugins/upload.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/upload.py b/plugins/upload.py
index 5e6dfb04..c702dc49 100644
--- a/plugins/upload.py
+++ b/plugins/upload.py
@@ -24,7 +24,7 @@ import traceback
from os.path import expanduser
from glob import glob
-from slixmpp.plugins.xep_0363.http_upload import UploadServiceNotFound
+from slixmpp.plugins.xep_0363.http_upload import FileTooBig, HTTPError, UploadServiceNotFound
from poezio.plugin import BasePlugin
from poezio.core.structs import Completion
@@ -56,6 +56,9 @@ class Plugin(BasePlugin):
except UploadServiceNotFound:
self.api.information('HTTP Upload service not found.', 'Error')
return None
+ except (FileTooBig, HTTPError) as exn:
+ self.api.information(str(exn), 'Error')
+ return None
except Exception:
exception = traceback.format_exc()
self.api.information('Failed to upload file: %s' % exception,