Handle RemoteDisconnected error

This commit is contained in:
Marcin Kulik
2017-12-01 22:28:30 +01:00
parent 134ca2c9d8
commit 4286e8f480

View File

@@ -3,6 +3,7 @@ import sys
import uuid
import io
import base64
import http
from urllib.request import Request, urlopen
from urllib.error import HTTPError, URLError
@@ -80,7 +81,7 @@ class URLLibHttpAdapter:
status = e.code
headers = {}
body = e.read().decode('utf-8')
except URLError as e:
except (http.client.RemoteDisconnected, URLError) as e:
raise HTTPConnectionError(str(e))
return (status, headers, body)