better curl error handling, found myself pushing 400 docs to s3 by accident