Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
78ee782b
Unverified
Commit
78ee782b
authored
Oct 23, 2021
by
Aaron Gokaslan
Committed by
GitHub
Oct 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Add C++ binding to throw AttributeError (#3387)
* Add C++ bindings to throw AttributeError * Fix formatting bug
parent
076c89fc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
docs/advanced/exceptions.rst
+3
-1
include/pybind11/detail/common.h
+1
-0
No files found.
docs/advanced/exceptions.rst
View file @
78ee782b
...
@@ -56,7 +56,9 @@ at its exception handler.
...
@@ -56,7 +56,9 @@ at its exception handler.
+--------------------------------------+--------------------------------------+
+--------------------------------------+--------------------------------------+
| :class:`pybind11::buffer_error` | ``BufferError`` |
| :class:`pybind11::buffer_error` | ``BufferError`` |
+--------------------------------------+--------------------------------------+
+--------------------------------------+--------------------------------------+
| :class:`pybind11::import_error` | ``import_error`` |
| :class:`pybind11::import_error` | ``ImportError`` |
+--------------------------------------+--------------------------------------+
| :class:`pybind11::attribute_error` | ``AttributeError`` |
+--------------------------------------+--------------------------------------+
+--------------------------------------+--------------------------------------+
| Any other exception | ``RuntimeError`` |
| Any other exception | ``RuntimeError`` |
+--------------------------------------+--------------------------------------+
+--------------------------------------+--------------------------------------+
...
...
include/pybind11/detail/common.h
View file @
78ee782b
...
@@ -831,6 +831,7 @@ PYBIND11_RUNTIME_EXCEPTION(value_error, PyExc_ValueError)
...
@@ -831,6 +831,7 @@ PYBIND11_RUNTIME_EXCEPTION(value_error, PyExc_ValueError)
PYBIND11_RUNTIME_EXCEPTION
(
type_error
,
PyExc_TypeError
)
PYBIND11_RUNTIME_EXCEPTION
(
type_error
,
PyExc_TypeError
)
PYBIND11_RUNTIME_EXCEPTION
(
buffer_error
,
PyExc_BufferError
)
PYBIND11_RUNTIME_EXCEPTION
(
buffer_error
,
PyExc_BufferError
)
PYBIND11_RUNTIME_EXCEPTION
(
import_error
,
PyExc_ImportError
)
PYBIND11_RUNTIME_EXCEPTION
(
import_error
,
PyExc_ImportError
)
PYBIND11_RUNTIME_EXCEPTION
(
attribute_error
,
PyExc_AttributeError
)
PYBIND11_RUNTIME_EXCEPTION
(
cast_error
,
PyExc_RuntimeError
)
/// Thrown when pybind11::cast or handle::call fail due to a type casting error
PYBIND11_RUNTIME_EXCEPTION
(
cast_error
,
PyExc_RuntimeError
)
/// Thrown when pybind11::cast or handle::call fail due to a type casting error
PYBIND11_RUNTIME_EXCEPTION
(
reference_cast_error
,
PyExc_RuntimeError
)
/// Used internally
PYBIND11_RUNTIME_EXCEPTION
(
reference_cast_error
,
PyExc_RuntimeError
)
/// Used internally
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment