From 11d606f79e8a848321122e0e57270ba5a38c582c Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 2 Dec 2011 19:00:01 +0000 Subject: [PATCH] {Filter,Highlighter}Registry: more infos on factory not found --- src/filter_registry.cc | 5 +++-- src/highlighter_registry.cc | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/filter_registry.cc b/src/filter_registry.cc index d6a71ba0..c931b567 100644 --- a/src/filter_registry.cc +++ b/src/filter_registry.cc @@ -8,7 +8,8 @@ namespace Kakoune struct factory_not_found : public runtime_error { - factory_not_found() : runtime_error("filter factory not found") {} + factory_not_found(const std::string& name) + : runtime_error("filter factory not found '" + name + "'") {} }; void FilterRegistry::register_factory(const std::string& name, @@ -24,7 +25,7 @@ void FilterRegistry::add_filter_to_buffer(Buffer& buffer, { auto it = m_factories.find(name); if (it == m_factories.end()) - throw factory_not_found(); + throw factory_not_found(name); buffer.add_filter(it->second(buffer, parameters)); } diff --git a/src/highlighter_registry.cc b/src/highlighter_registry.cc index 88f541c5..ca5669ca 100644 --- a/src/highlighter_registry.cc +++ b/src/highlighter_registry.cc @@ -8,7 +8,8 @@ namespace Kakoune struct factory_not_found : public runtime_error { - factory_not_found() : runtime_error("factory not found") {} + factory_not_found(const std::string& name) + : runtime_error("highlighter factory not found '" + name + "'") {} }; void HighlighterRegistry::register_factory(const std::string& name, @@ -24,7 +25,7 @@ void HighlighterRegistry::add_highlighter_to_window(Window& window, { auto it = m_factories.find(name); if (it == m_factories.end()) - throw factory_not_found(); + throw factory_not_found(name); window.add_highlighter(it->second(window, parameters)); }