Skip to content

Commit 6da743d

Browse files
committed
Catch all exceptions and only show messages
1 parent 2c3c0e4 commit 6da743d

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/lazydocs/_cli.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,20 @@ def generate(
4545
) -> None:
4646
"""Generates markdown documentation for your Python project based on Google-style docstrings."""
4747

48-
generate_docs(
49-
paths=paths,
50-
output_path=output_path,
51-
src_base_url=src_base_url,
52-
remove_package_prefix=remove_package_prefix,
53-
ignored_modules=ignored_modules,
54-
overview_file=overview_file,
55-
watermark=watermark,
56-
validate=validate,
57-
)
48+
try:
49+
generate_docs(
50+
paths=paths,
51+
output_path=output_path,
52+
src_base_url=src_base_url,
53+
remove_package_prefix=remove_package_prefix,
54+
ignored_modules=ignored_modules,
55+
overview_file=overview_file,
56+
watermark=watermark,
57+
validate=validate,
58+
)
59+
except Exception as ex:
60+
typer.echo(str(ex))
61+
raise typer.Exit(code=1)
5862

5963

6064
if __name__ == "__main__":

0 commit comments

Comments
 (0)