Do not show statistics if exception happens

This commit is contained in:
Alexey Korepanov 2024-08-25 11:27:43 +02:00
parent b772140514
commit 06f0267ed1

View File

@ -117,6 +117,7 @@ void JSONCompactWithProgressRowOutputFormat::writeProgress()
void JSONCompactWithProgressRowOutputFormat::finalizeImpl()
{
if (exception_message.empty()) {
JSONUtils::writeCompactAdditionalInfo(
row_count,
statistics.rows_before_limit,
@ -125,10 +126,7 @@ void JSONCompactWithProgressRowOutputFormat::finalizeImpl()
statistics.progress,
settings.write_statistics && exception_message.empty(),
*ostr);
if (!exception_message.empty())
{
writeCString("\n", *ostr);
} else {
JSONUtils::writeCompactObjectStart(*ostr);
JSONUtils::writeException(exception_message, *ostr, settings, 0);
JSONUtils::writeCompactObjectEnd(*ostr);