1
0
Fork 0

fixthedocs.com

This commit is contained in:
jsteemann 2018-08-14 12:02:53 +02:00
parent 7b5b112b88
commit b09638a883
5 changed files with 29 additions and 21 deletions

View File

@ -136,7 +136,7 @@ You should see something like
@startDocuBlockInline JSON_07_fetchroutingCreateHelloEcho
@EXAMPLE_ARANGOSH_OUTPUT{JSON_07_fetchroutingCreateHelloEcho}
arango.GET("/hello/echo")
arango.GET_RAW("/hello/echo", { "accept" : "application/json" })
@END_EXAMPLE_ARANGOSH_OUTPUT
@endDocuBlock JSON_07_fetchroutingCreateHelloEcho
@ -199,7 +199,7 @@ Reload the routing and check http:// 127.0.0.1:8529/hello/echo:
@startDocuBlockInline JSON_10_fetchroutingCreateEchoController
@EXAMPLE_ARANGOSH_OUTPUT{JSON_10_fetchroutingCreateEchoController}
arango.GET("/hello/echo")
arango.GET_RAW("/hello/echo", { "accept" : "application/json" })
@END_EXAMPLE_ARANGOSH_OUTPUT
@endDocuBlock JSON_10_fetchroutingCreateEchoController
@ -271,7 +271,7 @@ You can also store a function directly in the routing table.
@startDocuBlockInline JSON_12b_fetchroutingEchoFunction
@EXAMPLE_ARANGOSH_OUTPUT{JSON_12b_fetchroutingEchoFunction}
arango.GET("hello/echo")
arango.GET_RAW("hello/echo", { "accept" : "application/json" })
db._query("FOR route IN _routing FILTER route.url == '/hello/echo' REMOVE route in _routing")
require("internal").reloadRouting()
@END_EXAMPLE_ARANGOSH_OUTPUT
@ -317,7 +317,7 @@ You should see something like
@startDocuBlockInline JSON_14_fetchroutingRequestHelloEcho
@EXAMPLE_ARANGOSH_OUTPUT{JSON_14_fetchroutingRequestHelloEcho}
arango.GET("/hello/echo")
arango.GET_RAW("/hello/echo", { "accept" : "application/json" })
db._query("FOR route IN _routing FILTER route.url == '/hello/echo' REMOVE route in _routing")
require("internal").reloadRouting()
@END_EXAMPLE_ARANGOSH_OUTPUT
@ -344,7 +344,7 @@ You now see the options in the result:
@startDocuBlockInline JSON_16_fetchroutingEchoRequestOptions
@EXAMPLE_ARANGOSH_OUTPUT{JSON_16_fetchroutingEchoRequestOptions}
arango.GET("/echo")
arango.GET_RAW("/echo", { accept: "application/json" })
db._query("FOR route IN _routing FILTER route.url == '/echo' REMOVE route in _routing")
require("internal").reloadRouting()
@END_EXAMPLE_ARANGOSH_OUTPUT

View File

@ -82,7 +82,7 @@ deletes a function:
code : "function (x) { return x*x; }"
};
db._connection.POST("/_api/aqlfunction", JSON.stringify(body));
db._connection.POST("/_api/aqlfunction", body);
var response = logCurlRequest('DELETE', url);
assert(response.code === 200);

View File

@ -107,7 +107,7 @@ const log = function (a) {
appender(internal.stopCaptureMode());
};
var logCurlRequestRaw = internal.appendCurlRequest(shellAppender,jsonAppender, rawAppender);
var logCurlRequestRaw = internal.appendCurlRequest(shellAppender, jsonAppender, rawAppender);
var logCurlRequest = function () {
if ((arguments.length > 1) &&
(arguments[1] !== undefined) &&
@ -172,28 +172,25 @@ var runTestLine = function(line, testName, sourceFN, sourceLine, lineCount, show
/* jshint ignore:start */
if (!showCmd || isLoop) {
eval(line);
}
else {
} else {
eval("XXX = " + line);
}
/* jshint ignore:end */
if (expectError !== undefined) {
throw new Error("expected to throw with " + expectError + " but didn't!");
throw new Error("expected to throw with " + expectError + " but didn't!");
}
}
catch (err) {
if (expectError !== undefined) {
if (err.errorNum === errors[expectError].code) {
print(err);
}
else {
} else {
print(err);
createErrorMessage(err, line, testName, sourceFN, sourceLine, lineCount, " caught unexpected exception!");
}
}
else {
createErrorMessage(err, line, testName, sourceFN, sourceLine, lineCount, " caught an exception!\n");
print(err);
} else {
createErrorMessage(err, line, testName, sourceFN, sourceLine, lineCount, " caught an exception!\n");
print(err);
}
}
if (showCmd && XXX !== undefined) {
@ -258,12 +255,12 @@ var addIgnoreCollection = function(collectionName) {
var removeIgnoreCollection = function(collectionName) {
// print("from now on checking again whether this collection dropped: " + collectionName);
for (j=0; j < collectionAlreadyThere.length; j++) {
for (j = 0; j < collectionAlreadyThere.length; j++) {
if (collectionAlreadyThere[j] === collectionName) {
collectionAlreadyThere[j] = undefined;
}
}
for (j=0; j < ignoreCollectionAlreadyThere.length; j++) {
for (j = 0; j < ignoreCollectionAlreadyThere.length; j++) {
if (ignoreCollectionAlreadyThere[j] === collectionName) {
ignoreCollectionAlreadyThere[j] = undefined;
}

View File

@ -1649,6 +1649,9 @@ void Ast::injectBindParameters(
TRI_ASSERT(graphNode->isStringValue());
std::string graphName = graphNode->getString();
auto graph = _query->lookupGraphByName(graphName);
if (graph == nullptr) {
THROW_ARANGO_EXCEPTION(TRI_ERROR_GRAPH_NOT_FOUND);
}
TRI_ASSERT(graph != nullptr);
auto vColls = graph->vertexCollections();
@ -1686,6 +1689,9 @@ void Ast::injectBindParameters(
TRI_ASSERT(graphNode->isStringValue());
std::string graphName = graphNode->getString();
auto graph = _query->lookupGraphByName(graphName);
if (graph == nullptr) {
THROW_ARANGO_EXCEPTION(TRI_ERROR_GRAPH_NOT_FOUND);
}
TRI_ASSERT(graph != nullptr);
auto vColls = graph->vertexCollections();

View File

@ -158,13 +158,18 @@ let appendHeaders = function(appender, headers) {
return function (method, url, body, headers) {
var response;
var curl;
var i;
var jsonBody = false;
if ((typeof body !== 'string') && (body !== undefined)) {
jsonBody = true;
body = exports.inspect(body);
}
if (headers === undefined || headers === null || headers === '') {
headers = {};
}
if (!headers.hasOwnProperty('Accept') && !headers.hasOwnProperty('accept')) {
headers['accept'] = 'application/json';
}
curl = 'shell> curl ';
@ -185,12 +190,12 @@ let appendHeaders = function(appender, headers) {
} else if (method === 'HEAD') {
response = exports.arango.HEAD_RAW(url, headers);
curl += '-X ' + method + ' ';
} else if (method === 'OPTION') {
} else if (method === 'OPTION' || method === 'OPTIONS') {
response = exports.arango.OPTION_RAW(url, body, headers);
curl += '-X ' + method + ' ';
}
if (headers !== undefined && headers !== '') {
for (i in headers) {
for (let i in headers) {
if (headers.hasOwnProperty(i)) {
curl += "--header '" + i + ': ' + headers[i] + "' ";
}