Skip to content

Commit

Permalink
Improve handling for errors in pre-build commands (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner authored Oct 2, 2024
1 parent 5eedf72 commit 1771311
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sphinx_autobuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import contextlib
import subprocess
import sys
import traceback
from collections.abc import Sequence
from pathlib import Path

Expand Down Expand Up @@ -45,7 +46,14 @@ def __call__(self, *, changed_paths: Sequence[Path]):
"Please fix the cause of the error above or press Ctrl+C to stop the "
"server."
)
raise
print(
"The server will continue serving the build folder, but the contents "
"being served are no longer in sync with the documentation sources. "
"Please fix the cause of the error above or press Ctrl+C to stop the "
"server."
)
traceback.print_exception(e)
return

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

0 comments on commit 1771311

Please sign in to comment.