diff --git a/src/etc/htmldocck.py b/src/etc/htmldocck.py
index 8a11c6f7cfc..569788fe9c0 100644
--- a/src/etc/htmldocck.py
+++ b/src/etc/htmldocck.py
@@ -346,15 +346,19 @@ def check_tree_attr(tree, path, attr, pat, regexp):
def check_tree_text(tree, path, pat, regexp):
path = normalize_xpath(path)
ret = False
- for e in tree.findall(path):
- try:
- value = flatten(e)
- except KeyError:
- continue
- else:
- ret = check_string(value, pat, regexp)
- if ret:
- break
+ try:
+ for e in tree.findall(path):
+ try:
+ value = flatten(e)
+ except KeyError:
+ continue
+ else:
+ ret = check_string(value, pat, regexp)
+ if ret:
+ break
+ except Exception as e:
+ print('Failed to get path "{}"'.format(path))
+ raise e
return ret