Skip to content

Commit ecc86d4

Browse files
committed
request: catch socket.error
socket.error is another exception which is thrown by the underlying infrastacture and not handled by the urllib2 or httplib layers fixes python-telegram-bot#236
1 parent a9b305e commit ecc86d4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

telegram/utils/request.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ def decorator(*args, **kwargs):
106106
except HTTPException as error:
107107
raise NetworkError('HTTPException: {0!r}'.format(error))
108108

109+
except socket.error as error:
110+
raise NetworkError('socket.error: {0!r}'.format(error))
111+
109112
return decorator
110113

111114

0 commit comments

Comments
 (0)