We should find a possibility to replace the Type inspectors with working directly on velocypack data for faster checks. This is especially needed for lager transactions/responses.
Succesful response
{
"code": 200,
"error": false,
"result": {
"rId0": [
{
"_id": "c878c0b7e51ecaab95c511fc816ad2a70c9418208/100000000000000001",
"_key": "100000000000000001",
"_rev": "_WAf0iN----"
},
{
"_id": "c878c0b7e51ecaab95c511fc816ad2a70c9418208/100000000000000002",
"_key": "100000000000000002",
"_rev": "_WAf0iN---_"
}
]
}
}
Error response single type
Attention: Root error
key is false, but individual result has "error": true,
.
{
"code": 200,
"error": false,
"result": {
"rId0": [
{
"_id": "c878c0b7e51ecaab95c511fc816ad2a70c9418208/100000000000000001",
"_key": "100000000000000001",
"_rev": "_WAg_9aK---"
},
{
"_id": "c878c0b7e51ecaab95c511fc816ad2a70c9418208/100000000000000002",
"_key": "100000000000000002",
"_rev": "_WAg_9aK--_"
},
{
"error": true,
"errorMessage": "unique constraint violated - in index 0 of type primary over [\"_key\"]",
"errorNum": 1210
}
]
}
}
Error response multiple types
Attention: Root error
key is false, but individual result has "error": true,
.
{
"code": 200,
"error": false,
"result": {
"rId0": [
{
"_id": "c878c0b7e51ecaab95c511fc816ad2a70c9418208/100000000000000001",
"_key": "100000000000000001",
"_rev": "_WAgC_wq---"
},
{
"_id": "c878c0b7e51ecaab95c511fc816ad2a70c9418208/100000000000000002",
"_key": "100000000000000002",
"_rev": "_WAgC_wq--_"
}
],
"rId1": [
{
"error": true,
"errorMessage": "unique constraint violated - in index 0 of type primary over [\"_key\"]",
"errorNum": 1210
},
{
"error": true,
"errorMessage": "unique constraint violated - in index 0 of type primary over [\"_key\"]",
"errorNum": 1210
}
]
}
}
I would suggest to only find the first error object and transform it to an exception. A method to get all errors would be nice too. The error object under result
has the following structure:
{
"error": true,
"errorMessage": "unique constraint violated - in index 0 of type primary over [\"_key\"]",
"errorNum": 1210
}
Would be nice if there is a faster lookup instead of iterating through each result.