ConnectionError with Messenger bot
<p>I'm using messenger bot with pymessenger (here the link <a href="https://github.com/davidchua/pymessenger" rel="nofollow">https://github.com/davidchua/pymessenger</a> ).
Sometimes, when I try to send messages to the user using the bot.send_text_message() or one of the other functions to send messages of the python package, I got the following error:</p>

<pre><code>  File "C:\Python27\lib\site-packages\pymessenger\bot.py", line 29, in send_text_message
    return self._send_payload(payload)
  File "C:\Python27\lib\site-packages\pymessenger\bot.py", line 76, in _send_payload
    result = requests.post(self.base_url, json=payload).json()
  File "C:\Python27\lib\site-packages\requests\api.py", line 111, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "C:\Python27\lib\site-packages\requests\api.py", line 57, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Python27\lib\site-packages\requests\sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Python27\lib\site-packages\requests\sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "C:\Python27\lib\site-packages\requests\adapters.py", line 467, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='graph.facebook.com', port=443): Max retries exceeded with url: /v2.6/me/messages?access_token=&lt;my_token&gt; (Caused by NewConnectionError('&lt;requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000000422A40B8&gt;: Failed to establish a new connection: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond',))
</code></pre>

<p>I thought that maybe I did too many requests to Facebook, but it's just me to use the bot and the number of requests I'm doing is the one of a normal chat so I guess it should be something else, but I don't get what.
I'm using ngrok for the callbacks. </p>

<p>try to catch the HTTPSConnectionPool exception and look into its args to see the details I mean something like</p>

<pre><code>except HTTPSConnectionPool as e:
    e.args
</code></pre>

python bots facebook-messenger