mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #4256 from zlobober/useful_what_in_exceptions
Make exception.what() less useless.
This commit is contained in:
commit
7c830941a6
@ -88,7 +88,7 @@ std::string getCurrentExceptionMessage(bool with_stacktrace, bool check_embedded
|
||||
try
|
||||
{
|
||||
stream << "Poco::Exception. Code: " << ErrorCodes::POCO_EXCEPTION << ", e.code() = " << e.code()
|
||||
<< ", e.displayText() = " << e.displayText() << ", e.what() = " << e.what();
|
||||
<< ", e.displayText() = " << e.displayText();
|
||||
}
|
||||
catch (...) {}
|
||||
}
|
||||
@ -202,7 +202,7 @@ std::string getExceptionMessage(const Exception & e, bool with_stacktrace, bool
|
||||
}
|
||||
}
|
||||
|
||||
stream << "Code: " << e.code() << ", e.displayText() = " << text << ", e.what() = " << e.what();
|
||||
stream << "Code: " << e.code() << ", e.displayText() = " << text;
|
||||
|
||||
if (with_stacktrace && !has_embedded_stack_trace)
|
||||
stream << ", Stack trace:\n\n" << e.getStackTrace().toString();
|
||||
|
@ -33,6 +33,7 @@ public:
|
||||
Exception * clone() const override { return new Exception(*this); }
|
||||
void rethrow() const override { throw *this; }
|
||||
const char * name() const throw() override { return "DB::Exception"; }
|
||||
const char * what() const throw() override { return message().data(); }
|
||||
|
||||
/// Add something to the existing message.
|
||||
void addMessage(const std::string & arg) { extendedMessage(arg); }
|
||||
|
@ -20,7 +20,7 @@ function ch_url() {
|
||||
|
||||
# Check correct exceptions handling
|
||||
|
||||
exception_pattern="displayText() = DB::Exception:[[:print:]]* e\.what() = DB::Exception"
|
||||
exception_pattern="displayText() = DB::Exception:[[:print:]]*"
|
||||
|
||||
function check_only_exception() {
|
||||
local res=`ch_url "$1" "$2"`
|
||||
|
Loading…
Reference in New Issue
Block a user