summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2018-10-13 13:42:48 +0200
committermathieui <mathieui@mathieui.net>2018-10-13 13:42:48 +0200
commit3562bd4fc7bdd6248c78d10ddfe532f54bf918ff (patch)
treeb8e6345e71c680ff12f42add4d6b05d96a8bd4c7
parentb4b16c794a6df35ee0af2e6b57c2948976e8ec5e (diff)
parent284103d3700be866d2a4312122654da7074dbcf0 (diff)
downloadpoezio-3562bd4fc7bdd6248c78d10ddfe532f54bf918ff.tar.gz
poezio-3562bd4fc7bdd6248c78d10ddfe532f54bf918ff.tar.bz2
poezio-3562bd4fc7bdd6248c78d10ddfe532f54bf918ff.tar.xz
poezio-3562bd4fc7bdd6248c78d10ddfe532f54bf918ff.zip
Merge branch 'upload-error' into 'master'
upload: add user friendly error when upload service not found See merge request poezio/poezio!12
-rw-r--r--plugins/upload.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/upload.py b/plugins/upload.py
index 4013243a..db8615c2 100644
--- a/plugins/upload.py
+++ b/plugins/upload.py
@@ -21,6 +21,8 @@ import traceback
from os.path import expanduser
from glob import glob
+from slixmpp.plugins.xep_0363.http_upload import UploadServiceNotFound
+
from poezio.plugin import BasePlugin
from poezio.core.structs import Completion
from poezio.decorators import command_args_parser
@@ -44,6 +46,9 @@ class Plugin(BasePlugin):
async def async_upload(self, filename):
try:
url = await self.core.xmpp['xep_0363'].upload_file(filename)
+ except UploadServiceNotFound:
+ self.api.information('HTTP Upload service not found.', 'Error')
+ return
except Exception:
exception = traceback.format_exc()
self.api.information('Failed to upload file: %s' % exception,