title: How catch socket.io exceptions in python
body: <p>I am working on a class project and we are trying to catch a socket.io exception. Specifically, socketio.exceptions.ConnectionError: Connection refused by server
  The purpose of us doing this is to keep attempting to connect if not connection has been made. </p>
  
  <p>We tried looking through the documentation at <a href="https://python-socketio.readthedocs.io/en/latest/" rel="nofollow noreferrer">https://python-socketio.readthedocs.io/en/latest/</a> but could not find anything. Again, we are trying to attempt to connect to a server if connection has not been made. We were looking at socket.reconnect() but that appears to only work once a connection has been made. 
  We are trying to implement this on a raspberry pi 3. We wrote a script to execute our client code on start up but the ethernet connection is made to the pi after the script is executed. </p>
  
  <pre class="lang-py prettyprint-override"><code>
  import socketio
  import opc, time
  import json
  
  # Initiate socket client
  socket = socketio.Client()
  
  # Initiate socket client for fadecandy server (little chip between Led strip and Pi
  fade_client = opc.Client('localhost:xxxx')
  
  # Establish connection to server
  socket.connect("website url", namespaces=['/pi'])
  
  # stuff to do after connection, mainly change led lights through
  # fadecandy server
  </code></pre>