Skip to content

Commit 855a834

Browse files
committed
better
1 parent 9832d84 commit 855a834

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Common/Exception.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ namespace ErrorCodes
3939
extern const int CANNOT_ALLOCATE_MEMORY;
4040
extern const int CANNOT_MREMAP;
4141
extern const int POTENTIALLY_BROKEN_DATA_PART;
42-
extern const int REPLICA_ALREADY_EXISTS;
43-
extern const int NOT_ENOUGH_SPACE;
44-
extern const int CORRUPTED_DATA;
45-
extern const int CHECKSUM_DOESNT_MATCH;
46-
extern const int CANNOT_WRITE_TO_FILE_DESCRIPTOR;
4742
}
4843

4944
void abortOnFailedAssertion(const String & description, void * const * trace, size_t trace_offset, size_t trace_size)
@@ -279,9 +274,9 @@ bool Exception::isErrorCodeImportant() const
279274

280275
Exception::~Exception()
281276
{
282-
if (logged != nullptr && !logged->load(std::memory_order_relaxed) && isErrorCodeImportant())
277+
if (logged != nullptr && !logged->load(std::memory_order_relaxed) && isErrorCodeImportant() && isLoggingEnabled())
283278
{
284-
LOG_ERROR(getLogger("~Exception"), "An important exception was likely ignored, here it is: {}", getExceptionMessage(*this, /*with_stacktrace=*/ true));
279+
LOG_ERROR(getLogger("~Exception"), "{}", getExceptionMessage(*this, /*with_stacktrace=*/ true));
285280
}
286281
}
287282

0 commit comments

Comments
 (0)