InfluxDB Python - Testing DB for exceptions prior to function

I am currently converting my home automation system from MySQL to Influx. With MySQL I have the error checking down pat after using it for so many years.

With MySQL, I can specifically check for database connectivity at the server level, if the correct database exists, if the correct username and password are being used and finally just general DB errors that would prevent my program from running. In each of these cases, I can throw different exceptions and based on the exception send out the proper notification and/or switch to my backup database. If all else fails, it exits my program with a notification since my program is useless without database connectivity.

I have been reading THIS and THIS, but neither give me a good idea about how to track exceptions easily like I can do with MySQL (example below).

I was hoping someone could give me some pointers.

Thank You!

MySQL Exception Tracking:

        cnx = mysql.connector.connect(user=pooldb.username,
  except mysql.connector.Error as err:
    if err.errno == errorcode.ER_ACCESS_DENIED_ERROR: something here...
    elif err.errno == errorcode.ER_BAD_DB_ERROR: something here...
    elif err.errno == errorcode.CR_CONN_HOST_ERROR: something here...