Catches database connection error.