Description
Currently, when an ExtensionError
happens during build, the text Extension error:
followed by the actual error message is shown.
This is helpful if the error message from the extension is clear about what to do to fix the problem.
However, if there are many extensions and the error message isn't quite as clear, a user might have no idea where this message even came from.
Of course, extension authors could try to include their extension name in each of the possible error messages, but I don't think this will happen in many cases and even if the extension name is added in some cases, it's easy to miss it in some other cases.
Would it be possible/feasible for Sphinx to check which extension caused which ExtensionError
and include the extension name in the error message?
Describe the bug
An ExtensionError
doesn't show which extension caused it.
To Reproduce
conf.py
:
extensions = ['sphinx.ext.intersphinx']
intersphinx_mapping = {
'sphinx': NotImplemented,
}
This produces the following error message:
Extension error:
Handler <function load_mappings at 0x7f5e4d217310> for event 'builder-inited' threw an exception (exception: argument of type 'NotImplementedType' is not iterable)
Expected behavior
Extension error (sphinx.ext.intersphinx):
Handler <function load_mappings at 0x7f5e4d217310> for event 'builder-inited' threw an exception (exception: argument of type 'NotImplementedType' is not iterable)
This doesn't make the error message itself better, but at least I know I should start looking at the intersphinx
extension and its settings ...