How to document an exception using Sphinx?
You can use a backslash for line continuation:
def some_funct():
"""
:raises ExceptionType: Some multi-line \
exception description.
"""
Update:
Indenting seems to work instead of escaping the newline:
def some_funct():
"""
:raises ExceptionType: Some multi-line
exception description.
"""
def some_funct():
"""
My documentation, but watch the empty line below (necessary)
:raise: Exception
when status != my_status
| status <= max_status
Note: https://pythonhosted.org/an_example_pypi_project/sphinx.html#full-code-example has some nice samples (not on the multi-line exception unfortunately)