Skip to content

Conversation

@dalcinl
Copy link

@dalcinl dalcinl commented Dec 14, 2025

Purpose

Traditionally, Sphinx's autosummary generation for exceptions is quite succinct: just the class name and the docstring if any. This make sense in general, as Exception subclasses typically do not add attributes and methods. However, in the case of a more complex exception class with additional attributes and methods, users could create a custom autosummary/exception.rst template to render additional content in the Exception subclass.

The second commit in this PR enhances autodoc to populate members/attributes/methods in exceptions, treating them similarly as a class. By default, the template machinery will still render exceptions in a succinct way (through the fallback to the autosummary/base.rst template). However, users can not implement their own autosummary/exception.rst template for a more detailed rendering of their Exception subclasses.

@AA-Turner AA-Turner changed the title Fix autosummary autosummary: Add support for Exception subclasses Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants