From 489d6c5400e48d024e19e1ab3b75bbad4f3eafd6 Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Tue, 5 Apr 2016 15:52:13 +0200 Subject: [PATCH] The OperationResult now optionally contains a map errorCode => count. Which is used to report errors in Baby-case. --- arangod/Utils/OperationResult.h | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/arangod/Utils/OperationResult.h b/arangod/Utils/OperationResult.h index 313de68534..c91c331599 100644 --- a/arangod/Utils/OperationResult.h +++ b/arangod/Utils/OperationResult.h @@ -55,12 +55,23 @@ struct OperationResult { OperationResult(std::shared_ptr> buffer, std::shared_ptr handler, - std::string const& message, - int code, - bool wasSynchronous) - : buffer(buffer), customTypeHandler(handler), errorMessage(message), - code(code), wasSynchronous(wasSynchronous) { - } + std::string const& message, int code, bool wasSynchronous) + : buffer(buffer), + customTypeHandler(handler), + errorMessage(message), + code(code), + wasSynchronous(wasSynchronous) {} + + OperationResult(std::shared_ptr> buffer, + std::shared_ptr handler, + std::string const& message, int code, bool wasSynchronous, + std::unordered_map countErrorCodes) + : buffer(buffer), + customTypeHandler(handler), + errorMessage(message), + code(code), + wasSynchronous(wasSynchronous), + countErrorCodes(countErrorCodes) {} virtual ~OperationResult() { } @@ -85,6 +96,11 @@ struct OperationResult { std::string errorMessage; int code; bool wasSynchronous; + + // Executive summary for baby operations: reports all errors that did occur + // during these operations. Details are stored in the respective positions of + // the failed documents. + std::unordered_map countErrorCodes; }; }