exceptions: add a constructor based on custom message

OverloadedException was historically only used when the number
of in-flight hints got too high. The other constructor will be useful
for using OverloadedException in other scenarios.
This commit is contained in:
Piotr Sarna
2020-09-24 10:18:46 +02:00
parent 8366d2231d
commit b0737542f2

View File

@@ -228,6 +228,8 @@ struct read_failure_exception : public request_failure_exception {
struct overloaded_exception : public cassandra_exception {
overloaded_exception(size_t c) noexcept :
cassandra_exception(exception_code::OVERLOADED, prepare_message("Too many in flight hints: %lu", c)) {}
explicit overloaded_exception(sstring msg) noexcept :
cassandra_exception(exception_code::OVERLOADED, std::move(msg)) {}
};
class request_validation_exception : public cassandra_exception {