* 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. */
| 3570 | * the exception. |
| 3571 | */ |
| 3572 | inline 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. |