handle curl errors, pass exit status along