When the connection fails, catch the error