1
0
Fork 0

Add hexdump when vaidation fails for incoming VPackSlice

This commit is contained in:
Jan Christoph Uhde 2017-03-03 22:36:10 +01:00
parent b4cdafaef9
commit d4000ebf70
1 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,7 @@
#include <velocypack/Options.h>
#include <velocypack/Slice.h>
#include <velocypack/Validator.h>
#include <velocypack/HexDump.h>
#include <velocypack/velocypack-aliases.h>
#include <memory>
@ -60,6 +61,10 @@ inline std::size_t validateAndCount(char const* vpStart,
} while (vpStart != vpEnd);
return numPayloads - 1;
} 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(
std::string("error during validation of incoming VPack: ") + e.what());
}