Make sure connection works or exit with proper error