mirror of https://github.com/kiwix/libkiwix.git
Raise a exception if something went wrong in the template rendering.
This commit is contained in:
parent
288b4ae7df
commit
cb62da65c3
|
@ -164,6 +164,9 @@ std::string SearchRenderer::getHtml()
|
||||||
|
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
tmpl.render(allData, [&ss](const std::string& str) { ss << str; });
|
tmpl.render(allData, [&ss](const std::string& str) { ss << str; });
|
||||||
|
if (!tmpl.is_valid()) {
|
||||||
|
throw std::runtime_error("Error while rendering search results: " + tmpl.error_message());
|
||||||
|
}
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue