add loggers and try...except
@@ -111,6 +111,9 @@ class PageDocument(RTDDocTypeMixin, DocType):
def prepare_domains(self, html_file):
"""Prepares and returns the values for domains field."""
+ all_domains = []
+
+ try:
domains_qs = html_file.sphinx_domains.exclude(
domain='std',
type__in=['doc', 'label']
@@ -129,6 +132,20 @@ class PageDocument(RTDDocTypeMixin, DocType):
for domain in domains_qs
]
+ log.debug("[%s] [%s] Domains for file %s are: %s" % (
+ html_file.project.slug,
+ html_file.version.slug,
+ html_file.path,
+ all_domains,
+ ))
+
+ except Exception:
+ log.exception("[%s] [%s] Error preparing domain data for file %s" % (
+ html_file.project.slug,
+ html_file.version.slug,
+ html_file.path,
+ ))
+
return all_domains
@classmethod
