diff --git a/thrift/handler.cc b/thrift/handler.cc index 128add2050..51f912b82b 100644 --- a/thrift/handler.cc +++ b/thrift/handler.cc @@ -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("unable to find class '%s'", nc.what()); + throw make_exception(nc.what()); } catch (std::exception& e) { // Unexpected exception, wrap it throw ::apache::thrift::TException(std::string("Internal server error: ") + e.what()); diff --git a/utils/class_registrator.hh b/utils/class_registrator.hh index d373d8fabb..31c4ed1e85 100644 --- a/utils/class_registrator.hh +++ b/utils/class_registrator.hh @@ -52,7 +52,7 @@ template std::unique_ptr class_registry::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...); }