mirror of https://gitee.com/bigwinds/arangodb
Add hexdump when vaidation fails for incoming VPackSlice
This commit is contained in:
parent
b4cdafaef9
commit
d4000ebf70
|
@ -31,6 +31,7 @@
|
||||||
#include <velocypack/Options.h>
|
#include <velocypack/Options.h>
|
||||||
#include <velocypack/Slice.h>
|
#include <velocypack/Slice.h>
|
||||||
#include <velocypack/Validator.h>
|
#include <velocypack/Validator.h>
|
||||||
|
#include <velocypack/HexDump.h>
|
||||||
#include <velocypack/velocypack-aliases.h>
|
#include <velocypack/velocypack-aliases.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@ -60,6 +61,10 @@ inline std::size_t validateAndCount(char const* vpStart,
|
||||||
} while (vpStart != vpEnd);
|
} while (vpStart != vpEnd);
|
||||||
return numPayloads - 1;
|
return numPayloads - 1;
|
||||||
} catch (std::exception const& e) {
|
} catch (std::exception const& e) {
|
||||||
|
VPackSlice slice(vpStart);
|
||||||
|
VPackHexDump dump(slice);
|
||||||
|
LOG_TOPIC(DEBUG, Logger::COMMUNICATION)
|
||||||
|
<< "len: " << std::distance(vpStart, vpEnd) << " - " << dump ;
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
std::string("error during validation of incoming VPack: ") + e.what());
|
std::string("error during validation of incoming VPack: ") + e.what());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue