2010-06-04 18:25:25 +00:00
|
|
|
#include <DB/IO/WriteHelpers.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2012-05-08 05:42:05 +00:00
|
|
|
void writeException(const Exception & e, WriteBuffer & buf)
|
|
|
|
{
|
|
|
|
writeBinary(e.code(), buf);
|
|
|
|
writeBinary(String(e.name()), buf);
|
2012-07-21 06:47:17 +00:00
|
|
|
writeBinary(e.displayText(), buf);
|
2012-05-08 05:42:05 +00:00
|
|
|
writeBinary(e.getStackTrace().toString(), buf);
|
|
|
|
|
2014-04-08 07:31:51 +00:00
|
|
|
bool has_nested = e.nested() != nullptr;
|
2012-05-08 05:42:05 +00:00
|
|
|
writeBinary(has_nested, buf);
|
|
|
|
|
|
|
|
if (has_nested)
|
|
|
|
writeException(Exception(*e.nested()), buf);
|
|
|
|
}
|
|
|
|
|
2010-06-04 18:25:25 +00:00
|
|
|
}
|