{Filter,Highlighter}Registry: more infos on factory not found

This commit is contained in:
Maxime Coste 2011-12-02 19:00:01 +00:00
parent 0b4ed2280f
commit 11d606f79e
2 changed files with 6 additions and 4 deletions

View File

@ -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));
}

View File

@ -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));
}