mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-01 13:45:53 +00:00
class_registrator: make no_such_class message more informative
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
This commit is contained in:
committed by
Avi Kivity
parent
b96f2d4cee
commit
bfe6446a89
@@ -63,7 +63,7 @@ public:
|
||||
// is fine. Also, we don't want to change its type.
|
||||
throw;
|
||||
} catch (no_such_class& nc) {
|
||||
throw make_exception<InvalidRequestException>("unable to find class '%s'", nc.what());
|
||||
throw make_exception<InvalidRequestException>(nc.what());
|
||||
} catch (std::exception& e) {
|
||||
// Unexpected exception, wrap it
|
||||
throw ::apache::thrift::TException(std::string("Internal server error: ") + e.what());
|
||||
|
||||
@@ -52,7 +52,7 @@ template<typename BaseType, typename... Args>
|
||||
std::unique_ptr<BaseType> class_registry<BaseType, Args...>::create(const sstring& name, Args... args) {
|
||||
auto it = _classes.find(name);
|
||||
if (it == _classes.end()) {
|
||||
throw no_such_class(name);
|
||||
throw no_such_class(sstring("unable to find class '") + name + sstring("'"));
|
||||
}
|
||||
return it->second(args...);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user