mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
Handle RemoteDisconnected error
This commit is contained in:
@@ -3,6 +3,7 @@ import sys
|
|||||||
import uuid
|
import uuid
|
||||||
import io
|
import io
|
||||||
import base64
|
import base64
|
||||||
|
import http
|
||||||
|
|
||||||
from urllib.request import Request, urlopen
|
from urllib.request import Request, urlopen
|
||||||
from urllib.error import HTTPError, URLError
|
from urllib.error import HTTPError, URLError
|
||||||
@@ -80,7 +81,7 @@ class URLLibHttpAdapter:
|
|||||||
status = e.code
|
status = e.code
|
||||||
headers = {}
|
headers = {}
|
||||||
body = e.read().decode('utf-8')
|
body = e.read().decode('utf-8')
|
||||||
except URLError as e:
|
except (http.client.RemoteDisconnected, URLError) as e:
|
||||||
raise HTTPConnectionError(str(e))
|
raise HTTPConnectionError(str(e))
|
||||||
|
|
||||||
return (status, headers, body)
|
return (status, headers, body)
|
||||||
|
|||||||
Reference in New Issue
Block a user