We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 206802c commit 0b4c23fCopy full SHA for 0b4c23f
telegram/utils/request.py
@@ -20,6 +20,7 @@
20
"""This module contains methods to make POST and GET requests"""
21
22
import json
23
+import socket
24
from ssl import SSLError
25
26
try:
@@ -111,11 +112,11 @@ def post(url,
111
112
113
message = _parse(error.read())
114
raise TelegramError(message)
- except SSLError as error:
115
- if "operation timed out" in error.message:
+ except (SSLError, socket.timeout) as error:
116
+ if "operation timed out" in str(error):
117
raise TelegramError("Timed out")
118
- raise TelegramError(error.message)
119
+ raise TelegramError(str(error))
120
return _parse(result)
121
122
0 commit comments