Tiny grammar fix in error_handling.md
This commit is contained in:
parent
bb05896324
commit
f3d7cf6fac
|
@ -13,7 +13,7 @@ Rust code uses the generic [`Result<T, E>`] enum to propagate errors. The error
|
|||
PyO3 has the [`PyErr`] type which represents a Python exception. If a PyO3 API could result in a Python exception being raised, the return type of that `API` will be [`PyResult<T>`], which is an alias for the type `Result<T, PyErr>`.
|
||||
|
||||
In summary:
|
||||
- When Python exceptions are raised and caught by PyO3, the exception will stored in the `Err` variant of the `PyResult`.
|
||||
- When Python exceptions are raised and caught by PyO3, the exception will be stored in the `Err` variant of the `PyResult`.
|
||||
- Passing Python exceptions through Rust code then uses all the "normal" techniques such as the `?` operator, with `PyErr` as the error type.
|
||||
- Finally, when a `PyResult` crosses from Rust back to Python via PyO3, if the result is an `Err` variant the contained exception will be raised.
|
||||
|
||||
|
|
Loading…
Reference in New Issue