ClickHouse/dbms/src/IO/WriteHelpers.cpp
2014-04-08 11:31:51 +04:00

21 lines
406 B
C++

#include <DB/IO/WriteHelpers.h>
namespace DB
{
void writeException(const Exception & e, WriteBuffer & buf)
{
writeBinary(e.code(), buf);
writeBinary(String(e.name()), buf);
writeBinary(e.displayText(), buf);
writeBinary(e.getStackTrace().toString(), buf);
bool has_nested = e.nested() != nullptr;
writeBinary(has_nested, buf);
if (has_nested)
writeException(Exception(*e.nested()), buf);
}
}