Use curl option --fail