diff --git a/akka-docs/_sphinx/exts/includecode.py b/akka-docs/_sphinx/exts/includecode.py index 7ea125f6ed..af5684e786 100644 --- a/akka-docs/_sphinx/exts/includecode.py +++ b/akka-docs/_sphinx/exts/includecode.py @@ -109,6 +109,11 @@ class IncludeCode(Directive): return count nonempty = filter(lambda l: l.strip(), lines) + if not nonempty: + return [document.reporter.error( + "Snippet ({}#{}) not found!".format(filename, section), + line=self.lineno + )] tabcounts = map(lambda l: countwhile(lambda c: c == ' ', l), nonempty) tabshift = min(tabcounts) if tabcounts else 0