Skip to content

Commit 1771311

Browse files
authored
Improve handling for errors in pre-build commands (#181)
1 parent 5eedf72 commit 1771311

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sphinx_autobuild/build.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import contextlib
66
import subprocess
77
import sys
8+
import traceback
89
from collections.abc import Sequence
910
from pathlib import Path
1011

@@ -45,7 +46,14 @@ def __call__(self, *, changed_paths: Sequence[Path]):
4546
"Please fix the cause of the error above or press Ctrl+C to stop the "
4647
"server."
4748
)
48-
raise
49+
print(
50+
"The server will continue serving the build folder, but the contents "
51+
"being served are no longer in sync with the documentation sources. "
52+
"Please fix the cause of the error above or press Ctrl+C to stop the "
53+
"server."
54+
)
55+
traceback.print_exception(e)
56+
return
4957

5058
if sphinx.version_info[:3] >= (7, 2, 3):
5159
sphinx_build_args = ["-m", "sphinx", "build"] + self.sphinx_args

0 commit comments

Comments
 (0)