From 560a69278c360f274f72c99575ddced20e367df5 Mon Sep 17 00:00:00 2001 From: tristanlatr Date: Thu, 26 Oct 2023 14:20:30 -0400 Subject: [PATCH] Add a better error message --- pydoctor/sphinx_ext/build_apidocs.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pydoctor/sphinx_ext/build_apidocs.py b/pydoctor/sphinx_ext/build_apidocs.py index 7082e148d..680dc7967 100644 --- a/pydoctor/sphinx_ext/build_apidocs.py +++ b/pydoctor/sphinx_ext/build_apidocs.py @@ -67,7 +67,12 @@ def on_build_finished(app: Sphinx, exception: Exception) -> None: temp_path = output_path.with_suffix('.pydoctor_temp') shutil.rmtree(sphinx_files, ignore_errors=True) - output_path.rename(sphinx_files) + try: + output_path.rename(sphinx_files) + except FileNotFoundError as e: + msg = str(e) + msg += '\nMake sur the pydoctor option --html-output is correctly configured.' + raise FileNotFoundError(msg) from e temp_path.rename(output_path)