1
0
Fork 0
mirror of https://gitlab.com/news-flash/article_scraper.git synced 2025-07-08 16:40:00 +02:00

less dramatic logging

This commit is contained in:
Jan Lukas Gernert 2020-01-27 02:03:06 +01:00
parent afe661fe6c
commit 23514aff9e

View file

@ -230,14 +230,14 @@ impl ArticleScraper {
thorw_if_empty: bool, thorw_if_empty: bool,
) -> Result<Vec<Node>, ScraperError> { ) -> Result<Vec<Node>, ScraperError> {
let res = xpath_ctx.evaluate(xpath).map_err(|()| { let res = xpath_ctx.evaluate(xpath).map_err(|()| {
error!("Evaluation of xpath '{}' yielded no results", xpath); debug!("Evaluation of xpath '{}' yielded no results", xpath);
ScraperErrorKind::Xml ScraperErrorKind::Xml
})?; })?;
let node_vec = res.get_nodes_as_vec(); let node_vec = res.get_nodes_as_vec();
if node_vec.len() == 0 { if node_vec.len() == 0 {
error!("Evaluation of xpath '{}' yielded no results", xpath); debug!("Evaluation of xpath '{}' yielded no results", xpath);
if thorw_if_empty { if thorw_if_empty {
return Err(ScraperErrorKind::Xml)?; return Err(ScraperErrorKind::Xml)?;
} }