Commit 1b974d2d authored by Maxime Buquet's avatar Maxime Buquet

Merge branch 'upload-exceptions' into 'master'

plugins/upload: handle more exceptions

See merge request poezio/poezio!97
parents ac3fb695 8b385a0c
Pipeline #3094 failed with stages
in 5 minutes and 38 seconds
...@@ -24,7 +24,7 @@ import traceback ...@@ -24,7 +24,7 @@ import traceback
from os.path import expanduser from os.path import expanduser
from glob import glob 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.plugin import BasePlugin
from poezio.core.structs import Completion from poezio.core.structs import Completion
...@@ -56,6 +56,9 @@ class Plugin(BasePlugin): ...@@ -56,6 +56,9 @@ class Plugin(BasePlugin):
except UploadServiceNotFound: except UploadServiceNotFound:
self.api.information('HTTP Upload service not found.', 'Error') self.api.information('HTTP Upload service not found.', 'Error')
return None return None
except (FileTooBig, HTTPError) as exn:
self.api.information(str(exn), 'Error')
return None
except Exception: except Exception:
exception = traceback.format_exc() exception = traceback.format_exc()
self.api.information('Failed to upload file: %s' % exception, self.api.information('Failed to upload file: %s' % exception,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment