Raise a exception if something went wrong in the template rendering.

This commit is contained in:
Matthieu Gautier 2022-03-22 18:44:01 +01:00
parent 288b4ae7df
commit cb62da65c3
1 changed files with 3 additions and 0 deletions

View File

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