From bfe6446a894bc7c0985577ece0f2afae600a356c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dziepak?= Date: Mon, 8 Jun 2015 10:23:38 +0300 Subject: [PATCH] class_registrator: make no_such_class message more informative MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Dziepak --- thrift/handler.cc | 2 +- utils/class_registrator.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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...); }