Merge branch 'upload-exceptions' into 'master'
plugins/upload: handle more exceptions See merge request poezio/poezio!97
This commit is contained in:
commit
1b974d2d9a
1 changed files with 4 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue