Skip to content

Commit 5d07ab0

Browse files
committed
List all the pyind11 exceptions.
For curious readers, see `translate_exception` and `PYBIND11_RUNTIME_EXCEPTION.
1 parent 1cd9965 commit 5d07ab0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

docs/advanced/exceptions.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@ that will trap C++ exceptions, translate them to the corresponding Python except
99
and raise them so that Python code can handle them.
1010

1111
pybind11 defines translations for ``std::exception`` and its standard
12-
subclasses (see [translate_exception]_) and several special exception classes
13-
that translate to specific Python exceptions (see [PYBIND11_RUNTIME_EXCEPTION]_).
12+
subclasses and several special exception classes that translate to specific
13+
Python exceptions.
1414
Note that these are not actually Python exceptions, so they
1515
cannot be examined using the Python C API. Instead, they are pure C++ objects
1616
that pybind11 will translate the corresponding Python exception when they arrive
1717
at its exception handler.
1818

19-
.. [translate_exception] https://github.com/pybind/pybind11/search?q=translate_exception
20-
.. [PYBIND11_RUNTIME_EXCEPTION] https://github.com/pybind/pybind11/blob/master/include/pybind11/detail/common.h
21-
2219
.. tabularcolumns:: |p{0.5\textwidth}|p{0.45\textwidth}|
2320

2421
+--------------------------------------+--------------------------------------+
@@ -60,7 +57,7 @@ at its exception handler.
6057
+--------------------------------------+--------------------------------------+
6158
| :class:`pybind11::buffer_error` | ``BufferError`` |
6259
+--------------------------------------+--------------------------------------+
63-
| :class:`pybind11::import_error` | ``import_error` |
60+
| :class:`pybind11::import_error` | ``import_error`` |
6461
+--------------------------------------+--------------------------------------+
6562
| Any other exception | ``RuntimeError`` |
6663
+--------------------------------------+--------------------------------------+

0 commit comments

Comments
 (0)