1
0
Fork 0

The OperationResult now optionally contains a map errorCode => count. Which is used to report errors in Baby-case.

This commit is contained in:
Michael Hackstein 2016-04-05 15:52:13 +02:00
parent 1d43063189
commit 489d6c5400
1 changed files with 22 additions and 6 deletions

View File

@ -55,12 +55,23 @@ struct OperationResult {
OperationResult(std::shared_ptr<VPackBuffer<uint8_t>> buffer,
std::shared_ptr<VPackCustomTypeHandler> 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<VPackBuffer<uint8_t>> buffer,
std::shared_ptr<VPackCustomTypeHandler> handler,
std::string const& message, int code, bool wasSynchronous,
std::unordered_map<int, size_t> 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<int, size_t> countErrorCodes;
};
}