Cleanly exit if curl fails