mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-12 02:23:14 +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)
|
: Poco::Exception(msg, code)
|
||||||
{
|
{
|
||||||
// In debug builds, treat LOGICAL_ERROR as an assertion failure.
|
// 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)
|
Exception::Exception(CreateFromPocoTag, const Poco::Exception & exc)
|
||||||
|
Loading…
Reference in New Issue
Block a user