sphinx-autodoc-typehints
sphinx-autodoc-typehints copied to clipboard
Every warning/error should provide useful context
Warnings/errors with generic messages do not provide context for what in the code caused the error.
Specifically, I ran into it here:
https://github.com/tox-dev/sphinx-autodoc-typehints/blob/bf27befb610426838d1f2926e470815c47cc8ab8/src/sphinx_autodoc_typehints/init.py#L343
I changed that log to also print guarded_code and it helped a lot. But I really think it should reraise the exception with the guarded_code and then catch and log it here with additional context:
https://github.com/tox-dev/sphinx-autodoc-typehints/blob/bf27befb610426838d1f2926e470815c47cc8ab8/src/sphinx_autodoc_typehints/init.py#L347
when logging inside an except handler, it's often useful to include exc_info=True.