MCPcopy Create free account
hub / github.com/pybind/pybind11 / register_local_exception_translator

Function register_local_exception_translator

include/pybind11/pybind11.h:3572–3579  ·  view source on GitHub ↗

* Add a new module-local exception translator. Locally registered functions * will be tried before any globally registered exception translators, which * will only be invoked if the module-local handlers do not deal with * the exception. */

Source from the content-addressed store, hash-verified

3570 * the exception.
3571 */
3572inline void register_local_exception_translator(ExceptionTranslator &&translator) {
3573 detail::with_exception_translators(
3574 [&](std::forward_list<ExceptionTranslator> &exception_translators,
3575 std::forward_list<ExceptionTranslator> &local_exception_translators) {
3576 (void) exception_translators;
3577 local_exception_translators.push_front(std::forward<ExceptionTranslator>(translator));
3578 });
3579}
3580
3581/**
3582 * Wrapper to generate a new Python exception type.

Callers 2

TEST_SUBMODULEFunction · 0.85
PYBIND11_MODULEFunction · 0.85

Calls 1

Tested by 2

TEST_SUBMODULEFunction · 0.68
PYBIND11_MODULEFunction · 0.68