summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Klien <flowolf@klienux.org>2018-11-19 21:55:51 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-11-20 07:34:56 +0100
commit4699861925fa9201e0b65a0b761181daefbc0cd3 (patch)
tree5daa8b79b09bf7756e8b11f27d7748d0f4b479d9
parent570e653ac2beb5fdf56151334f65461b91085944 (diff)
downloadslixmpp-4699861925fa9201e0b65a0b761181daefbc0cd3.tar.gz
slixmpp-4699861925fa9201e0b65a0b761181daefbc0cd3.tar.bz2
slixmpp-4699861925fa9201e0b65a0b761181daefbc0cd3.tar.xz
slixmpp-4699861925fa9201e0b65a0b761181daefbc0cd3.zip
catch http upload errors on upload
-rw-r--r--slixmpp/plugins/xep_0363/http_upload.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/slixmpp/plugins/xep_0363/http_upload.py b/slixmpp/plugins/xep_0363/http_upload.py
index 2228ca8b..79a42412 100644
--- a/slixmpp/plugins/xep_0363/http_upload.py
+++ b/slixmpp/plugins/xep_0363/http_upload.py
@@ -148,6 +148,8 @@ class XEP_0363(BasePlugin):
data=input_file,
headers=headers,
timeout=timeout)
+ if response.status >= 400:
+ raise FileUploadError("could not upload file: %d (%s)" % (response.status, await response.text()))
log.info('Response code: %d (%s)', response.status, await response.text())
response.close()
return slot['get']['url']