def METHOD_NAME(self, e, connection, cursor):
    errnos = (2006, 2013, 2014, 2045, 2055, 2048)
    exceptions = (self.dbapi.OperationalError, self.dbapi.InterfaceError)
    if isinstance(e, exceptions):
        return e.errno in errnos or \
            "MySQL Connection not available." in str(e)
    else:
        return False