mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 18:50:49 +00:00
Merge pull request #9247 from ClickHouse/aku/logical-error-message
Log error message before aborting on LOGICAL_ERROR.
This commit is contained in:
commit
5c097f842f
@ -35,7 +35,14 @@ Exception::Exception(const std::string & msg, int code)
|
||||
: Poco::Exception(msg, code)
|
||||
{
|
||||
// In debug builds, treat LOGICAL_ERROR as an assertion failure.
|
||||
assert(code != ErrorCodes::LOGICAL_ERROR);
|
||||
// Log the message before we fail.
|
||||
#ifndef NDEBUG
|
||||
if (code == ErrorCodes::LOGICAL_ERROR)
|
||||
{
|
||||
LOG_ERROR(&Poco::Logger::root(), "Logical error: '" + msg + "'.");
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Exception::Exception(CreateFromPocoTag, const Poco::Exception & exc)
|
||||
|
Loading…
Reference in New Issue
Block a user