Skip to content

Commit 44714b7

Browse files
committed
added mkdocs yaml missing message to allign with sphinx
1 parent ade2e8f commit 44714b7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

readthedocs/doc_builder/backends/mkdocs.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from readthedocs.core.utils.filesystem import safe_open
1414
from readthedocs.doc_builder.base import BaseBuilder
15+
from readthedocs.doc_builder.exceptions import MkDocsYAMLParseError
1516
from readthedocs.projects.constants import MKDOCS, MKDOCS_HTML
1617

1718
log = structlog.get_logger(__name__)
@@ -33,7 +34,6 @@ def get_absolute_static_url():
3334

3435

3536
class BaseMkdocs(BaseBuilder):
36-
3737
"""Mkdocs builder."""
3838

3939
# The default theme for mkdocs is the 'mkdocs' theme
@@ -80,6 +80,11 @@ def get_yaml_config(self):
8080
def show_conf(self):
8181
"""Show the current ``mkdocs.yaml`` being used."""
8282
# Write the mkdocs.yml to the build logs
83+
if not os.path.exists(self.yaml_file):
84+
raise MkDocsYAMLParseError(
85+
message_id=MkDocsYAMLParseError.NOT_FOUND,
86+
)
87+
8388
self.run(
8489
"cat",
8590
os.path.relpath(self.yaml_file, self.project_path),
@@ -122,7 +127,6 @@ def __eq__(self, other):
122127

123128

124129
class SafeLoader(yaml.SafeLoader): # pylint: disable=too-many-ancestors
125-
126130
"""
127131
Safe YAML loader.
128132
@@ -141,7 +145,6 @@ def construct_python_name(self, suffix, node): # pylint: disable=unused-argumen
141145

142146

143147
class SafeDumper(yaml.SafeDumper):
144-
145148
"""
146149
Safe YAML dumper.
147150

0 commit comments

Comments
 (0)