{"id":14342,"date":"2021-12-15T00:12:24","date_gmt":"2021-12-15T00:12:24","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=14342"},"modified":"2021-12-15T00:13:25","modified_gmt":"2021-12-15T00:13:25","slug":"curl-not-returning-error-code","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/curl-not-returning-error-code\/24197.html","title":{"rendered":"CURL Not Returning Error Code"},"content":{"rendered":"<p>I am using cURL in a script to grab files at set intervals. My script currently includes the following:<\/p>\n<p>&#8220;C:\\cURL\\curl.exe&#8221; -u username:password -R &#8211;remote-name-all -K &#8220;C:\\curl\\filelist.txt&#8221;<br \/>\nif not ERRORLEVEL 0 goto end<\/p>\n<p>After this line I call an asp page that deletes the files that I just downloaded. Normally this works without issue but occasionally the server will return a 500 internal server error. When this happens, cURL still responds with an ERRORLEVEL of 0 instead of something else identifying a problem. So I am sometimes deleting files before I download them. The file names are dynamic so its not an option to check to see if a certain file exists. Any other thoughts?<\/p>\n<p>This specific script runs on various versions of Windows workstation and server all with the same results.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":14},"question-category":[55],"question_tags":[],"class_list":["post-14342","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/14342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=14342"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=14342"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=14342"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=14342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}