This commit is contained in:
Alexander Tokmakov 2023-08-16 00:20:28 +02:00
parent 78d8557a56
commit ba44d7260e
5 changed files with 12 additions and 17 deletions

View File

@ -110,8 +110,6 @@ void Keeper::createServer(const std::string & listen_host, const char * port_nam
}
catch (const Poco::Exception &)
{
std::string message = "Listen [" + listen_host + "]:" + std::to_string(port) + " failed: " + getCurrentExceptionMessage(false);
if (listen_try)
{
LOG_WARNING(&logger(), "Listen [{}]:{} failed: {}. If it is an IPv6 or IPv4 address and your host has disabled IPv6 or IPv4, "

View File

@ -549,7 +549,7 @@ LDAPClient::SearchResults LDAPClient::search(const SearchParams & search_params)
if (rc != LDAP_SUCCESS)
{
String message = "LDAP search failed";
String message;
const char * raw_err_str = ldap_err2string(rc);
if (raw_err_str && *raw_err_str != '\0')
@ -570,7 +570,7 @@ LDAPClient::SearchResults LDAPClient::search(const SearchParams & search_params)
message += matched_msg;
}
throw Exception::createDeprecated(message, ErrorCodes::LDAP_ERROR);
throw Exception(ErrorCodes::LDAP_ERROR, "LDAP search failed{}", message);
}
break;

View File

@ -429,12 +429,10 @@ void ProtobufReader::ignoreGroup()
[[noreturn]] void ProtobufReader::throwUnknownFormat() const
{
throw Exception::createDeprecated(
std::string("Protobuf messages are corrupted or don't match the provided schema.")
+ (root_message_has_length_delimiter
throw Exception(ErrorCodes::UNKNOWN_PROTOBUF_FORMAT, "Protobuf messages are corrupted or don't match the provided schema.{}",
root_message_has_length_delimiter
? " Please note that Protobuf stream is length-delimited: every message is prefixed by its length in varint."
: ""),
ErrorCodes::UNKNOWN_PROTOBUF_FORMAT);
: "");
}
}

View File

@ -163,12 +163,8 @@ static bool compareRetentions(const Retention & a, const Retention & b)
{
return false;
}
String error_msg = "age and precision should only grow up: "
+ std::to_string(a.age) + ":" + std::to_string(a.precision) + " vs "
+ std::to_string(b.age) + ":" + std::to_string(b.precision);
throw Exception::createDeprecated(
error_msg,
DB::ErrorCodes::BAD_ARGUMENTS);
throw Exception(DB::ErrorCodes::BAD_ARGUMENTS, "Age and precision should only grow up: {}:{} vs {}:{}",
a.age, a.precision, b.age, b.precision);
}
bool operator==(const Retention & a, const Retention & b)

View File

@ -352,7 +352,10 @@ def test_authentication():
def test_logs():
logs = query_and_get_logs("SELECT 1", settings={"send_logs_level": "debug"})
logs = query_and_get_logs(
"SELECT has(groupArray(number), 42) FROM numbers(1000)",
settings={"send_logs_level": "debug"},
)
assert "SELECT 1" in logs
assert "Read 1 rows" in logs
assert "Peak memory usage" in logs