Improve documentation of Python and C++ exceptions (#2408)

The main change is to treat error_already_set as a separate category
of exception that arises in different circumstances and needs to be
handled differently. The asymmetry between Python and C++ exceptions
is further emphasized.
This commit is contained in:
jbarlow83
2020-08-22 15:11:09 -07:00
committed by GitHub
parent c58f7b745b
commit b8863698d6
3 changed files with 141 additions and 37 deletions

View File

@@ -1,6 +1,8 @@
Python types
############
.. _wrappers:
Available wrappers
==================
@@ -168,3 +170,11 @@ Generalized unpacking according to PEP448_ is also supported:
Python functions from C++, including keywords arguments and unpacking.
.. _PEP448: https://www.python.org/dev/peps/pep-0448/
Handling exceptions
===================
Python exceptions from wrapper classes will be thrown as a ``py::error_already_set``.
See :ref:`Handling exceptions from Python in C++
<handling_python_exceptions_cpp>` for more information on handling exceptions
raised when calling C++ wrapper classes.