mirror of https://gitee.com/bigwinds/arangodb
add a way to specify excepted return codes
This commit is contained in:
parent
88aa18b90b
commit
0ed862b58b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue