mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-03 21:21:37 +00:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user