1
0
Fork 0

raise error if a broken URL was specified during creating the example.

This commit is contained in:
Willi Goesgens 2015-08-13 13:07:16 +02:00
parent dc1910e331
commit ab0c69df30
1 changed files with 6 additions and 0 deletions

View File

@ -156,6 +156,12 @@ var log = function (a) {
var logCurlRequestRaw = internal.appendCurlRequest(appender);
var logCurlRequest = function () {
if ((arguments.length > 1) &&
(arguments[1] !== undefined) &&
(arguments[1].length > 0) &&
(arguments[1][0] !== '/')) {
throw new Error("your URL doesn't start with a /! the example will be broken. [" + arguments[1] + "]")
}
var r = logCurlRequestRaw.apply(logCurlRequestRaw, arguments);
db._collections();
return r;