1
0
Fork 0

add a way to specify excepted return codes

This commit is contained in:
Wilfried Goesgens 2017-03-15 11:23:24 +01:00
parent 88aa18b90b
commit 0ed862b58b
1 changed files with 6 additions and 0 deletions

View File

@ -114,6 +114,12 @@ var curlRequestRaw = internal.appendCurlRequest(swallowText, swallowText, swallo
var curlRequest = function () {
rc = curlRequestRaw.apply(curlRequestRaw, arguments);
if (rc.code != 200) {
expectRC = arguments["4"];
if (typeof expectRC !== undefined) {
if (expectRC.indexOf(rc.code) >=0) {
return rc;
}
}
throw rc.code + " " + rc.errorMessage
}
return rc