mirror of https://gitee.com/bigwinds/arangodb
issue #339
This commit is contained in:
parent
b48d039e3f
commit
c77bcfb385
|
@ -19,6 +19,13 @@ v1.1.2 (XXXX-XX-XX)
|
|||
v1.1.1 (2012-12-18)
|
||||
-------------------
|
||||
|
||||
* fixed issue #339: DELETE /_api/cursor/cursor-identifier return incollect errorNum
|
||||
|
||||
The fix for this has led to a signature change of the function actions.resultNotFound().
|
||||
The meaning of parameter #3 for This function has changed from the error message string
|
||||
to the error code. The error message string is now parameter #4.
|
||||
Any client code that uses this function in custom actions must be adjusted.
|
||||
|
||||
* fixed issue #321: Problem upgrading arangodb 1.0.4 to 1.1.0 with Homebrew (OSX 10.8.2)
|
||||
|
||||
* fixed issue #230: add navigation and search for online documentation
|
||||
|
|
|
@ -260,7 +260,7 @@ describe ArangoDB do
|
|||
doc.code.should eq(404)
|
||||
doc.headers['content-type'].should eq("application/json; charset=utf-8")
|
||||
doc.parsed_response['error'].should eq(true)
|
||||
doc.parsed_response['errorNum'].should eq(404);
|
||||
doc.parsed_response['errorNum'].should eq(1600);
|
||||
doc.parsed_response['code'].should eq(404)
|
||||
end
|
||||
|
||||
|
@ -272,7 +272,7 @@ describe ArangoDB do
|
|||
doc.code.should eq(404)
|
||||
doc.headers['content-type'].should eq("application/json; charset=utf-8")
|
||||
doc.parsed_response['error'].should eq(true);
|
||||
doc.parsed_response['errorNum'].should eq(404);
|
||||
doc.parsed_response['errorNum'].should eq(1600);
|
||||
doc.parsed_response['code'].should eq(404)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -411,7 +411,7 @@
|
|||
}
|
||||
|
||||
else {
|
||||
actions.resultNotFound(req, res, "expecting one of the resources 'count', 'figures', 'properties', 'parameter'");
|
||||
actions.resultNotFound(req, res, internal.errors.ERROR_HTTP_NOT_FOUND.code, "expecting one of the resources 'count', 'figures', 'properties', 'parameter'");
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -659,7 +659,7 @@
|
|||
PUT_api_collection_rename(req, res, collection);
|
||||
}
|
||||
else {
|
||||
actions.resultNotFound(req, res, "expecting one of the actions 'load', 'unload', 'truncate', 'properties', 'rename'");
|
||||
actions.resultNotFound(req, res, internal.errors.ERROR_HTTP_NOT_FOUND.code, "expecting one of the actions 'load', 'unload', 'truncate', 'properties', 'rename'");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ var actions = require("org/arangodb/actions");
|
|||
|
||||
function POST_api_cursor(req, res) {
|
||||
if (req.suffix.length != 0) {
|
||||
actions.resultNotFound(req, res, actions.ERROR_HTTP_NOT_FOUND);
|
||||
actions.resultNotFound(req, res, internal.errors.ERROR_CURSOR_NOT_FOUND.code, internal.errors.ERROR_CURSOR_NOT_FOUND.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,7 @@ function DELETE_api_cursor(req, res) {
|
|||
|
||||
var cursorId = decodeURIComponent(req.suffix[0]);
|
||||
if (! DELETE_CURSOR(cursorId)) {
|
||||
actions.resultNotFound(req, res, actions.ERROR_CURSOR_NOT_FOUND);
|
||||
actions.resultNotFound(req, res, internal.errors.ERROR_CURSOR_NOT_FOUND.code, internal.errors.ERROR_CURSOR_NOT_FOUND.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ var actions = require("org/arangodb/actions");
|
|||
|
||||
function POST_api_explain (req, res) {
|
||||
if (req.suffix.length != 0) {
|
||||
actions.resultNotFound(req, res, actions.ERROR_HTTP_NOT_FOUND);
|
||||
actions.resultNotFound(req, res, internal.errors.ERROR_HTTP_NOT_FOUND.code, internal.errors.ERROR_HTTP_NOT_FOUND.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ var actions = require("org/arangodb/actions");
|
|||
|
||||
function POST_api_query (req, res) {
|
||||
if (req.suffix.length != 0) {
|
||||
actions.resultNotFound(req, res, actions.ERROR_HTTP_NOT_FOUND);
|
||||
actions.resultNotFound(req, res, internal.errors.ERROR_HTTP_NOT_FOUND.code, internal.errors.ERROR_HTTP_NOT_FOUND.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -505,7 +505,7 @@ actions.defineHttp({
|
|||
actions.resultOk(req, res, actions.HTTP_OK, { document : result.next() });
|
||||
}
|
||||
else {
|
||||
actions.resultNotFound(req, res, "no match");
|
||||
actions.resultNotFound(req, res, internal.errors.ERROR_HTTP_NOT_FOUND.code, "no match");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -292,7 +292,7 @@
|
|||
var user = internal.db._collection("_users").firstExample({ user : req.user });
|
||||
|
||||
if (user === null) {
|
||||
actions.resultNotFound(req, res, "unknown user '" + req.user + "'");
|
||||
actions.resultNotFound(req, res, internal.errors.ERROR_HTTP_NOT_FOUND.code, "unknown user '" + req.user + "'");
|
||||
}
|
||||
else {
|
||||
result = {
|
||||
|
|
|
@ -805,7 +805,7 @@ function getJsonBody (req, res, code) {
|
|||
/// @FUN{actions.resultError(@FA{req}, @FA{res}, @FA{code}, @FA{errorNum},
|
||||
/// @FA{errorMessage}, @FA{headers}, @FA{keyvals})}
|
||||
///
|
||||
/// The functions generates an error response. The response body is an array
|
||||
/// The function generates an error response. The response body is an array
|
||||
/// with an attribute @LIT{errorMessage} containing the error message
|
||||
/// @FA{errorMessage}, @LIT{error} containing @LIT{true}, @LIT{code} containing
|
||||
/// @FA{code}, @LIT{errorNum} containing @FA{errorNum}, and @LIT{errorMessage}
|
||||
|
@ -1074,7 +1074,7 @@ function badParameter (req, res, name) {
|
|||
///
|
||||
/// @FUN{actions.resultOk(@FA{req}, @FA{res}, @FA{code}, @FA{result}, @FA{headers}})}
|
||||
///
|
||||
/// The functions defines a response. @FA{code} is the status code to
|
||||
/// The function defines a response. @FA{code} is the status code to
|
||||
/// return. @FA{result} is the result object, which will be returned as JSON
|
||||
/// object in the body. @LIT{headers} is an array of headers to returned.
|
||||
/// The function adds the attribute @LIT{error} with value @LIT{false}
|
||||
|
@ -1105,7 +1105,7 @@ function resultOk (req, res, httpReturnCode, result, headers) {
|
|||
///
|
||||
/// @FUN{actions.resultBad(@FA{req}, @FA{res}, @FA{error-code}, @FA{msg}, @FA{headers})}
|
||||
///
|
||||
/// The functions generates an error response.
|
||||
/// The function generates an error response.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function resultBad (req, res, code, msg, headers) {
|
||||
|
@ -1122,13 +1122,13 @@ function resultBad (req, res, code, msg, headers) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief generates an error for not found
|
||||
///
|
||||
/// @FUN{actions.resultNotFound(@FA{req}, @FA{res}, @FA{msg}, @FA{headers})}
|
||||
/// @FUN{actions.resultNotFound(@FA{req}, @FA{res}, @FA{code}, @FA{msg}, @FA{headers})}
|
||||
///
|
||||
/// The functions generates an error response.
|
||||
/// The function generates an error response.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function resultNotFound (req, res, msg, headers) {
|
||||
resultError(req, res, exports.HTTP_NOT_FOUND, exports.ERROR_HTTP_NOT_FOUND, String(msg), headers);
|
||||
function resultNotFound (req, res, code, msg, headers) {
|
||||
resultError(req, res, exports.HTTP_NOT_FOUND, code, String(msg), headers);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1136,7 +1136,7 @@ function resultNotFound (req, res, msg, headers) {
|
|||
///
|
||||
/// @FUN{actions.resultNotImplemented(@FA{req}, @FA{res}, @FA{msg}, @FA{headers})}
|
||||
///
|
||||
/// The functions generates an error response.
|
||||
/// The function generates an error response.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function resultNotImplemented (req, res, msg, headers) {
|
||||
|
@ -1153,7 +1153,7 @@ function resultNotImplemented (req, res, msg, headers) {
|
|||
///
|
||||
/// @FUN{actions.resultUnsupported(@FA{req}, @FA{res}, @FA{headers})}
|
||||
///
|
||||
/// The functions generates an error response.
|
||||
/// The function generates an error response.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function resultUnsupported (req, res, headers) {
|
||||
|
@ -1168,7 +1168,7 @@ function resultUnsupported (req, res, headers) {
|
|||
///
|
||||
/// @FUN{actions.resultPermanentRedirect(@FA{req}, @FA{res}, @FA{destination}, @FA{headers})}
|
||||
///
|
||||
/// The functions generates an error response.
|
||||
/// The function generates an error response.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function resultPermanentRedirect (req, res, destination, headers) {
|
||||
|
@ -1197,7 +1197,7 @@ function resultPermanentRedirect (req, res, destination, headers) {
|
|||
///
|
||||
/// @FUN{actions.resultTemporaryRedirect(@FA{req}, @FA{res}, @FA{destination}, @FA{headers})}
|
||||
///
|
||||
/// The functions generates an error response.
|
||||
/// The function generates an error response.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function resultTemporaryRedirect (req, res, destination, headers) {
|
||||
|
@ -1298,7 +1298,7 @@ function resultCursor (req, res, cursor, code, options) {
|
|||
///
|
||||
/// @FUN{actions.collectionNotFound(@FA{req}, @FA{res}, @FA{collection}, @FA{headers})}
|
||||
///
|
||||
/// The functions generates an error response.
|
||||
/// The function generates an error response.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function collectionNotFound (req, res, collection, headers) {
|
||||
|
@ -1320,7 +1320,7 @@ function collectionNotFound (req, res, collection, headers) {
|
|||
///
|
||||
/// @FUN{actions.collectionNotFound(@FA{req}, @FA{res}, @FA{collection}, @FA{index}, @FA{headers})}
|
||||
///
|
||||
/// The functions generates an error response.
|
||||
/// The function generates an error response.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function indexNotFound (req, res, collection, index, headers) {
|
||||
|
@ -1348,7 +1348,7 @@ function indexNotFound (req, res, collection, index, headers) {
|
|||
///
|
||||
/// @FUN{actions.resultException(@FA{req}, @FA{res}, @FA{err}, @FA{headers})}
|
||||
///
|
||||
/// The functions generates an error response.
|
||||
/// The function generates an error response.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function resultException (req, res, err, headers) {
|
||||
|
|
Loading…
Reference in New Issue