Lines Matching defs:exception

17 #  pragma warning disable 878   // incompatible exception specifications
675 /* When an exception is caught, give each registered exception
676 translator a chance to translate it to a Python exception
681 - catch the exception and call PyErr_SetString or PyErr_SetObject
682 to set a standard (or custom) Python exception, or
683 - do nothing and let the exception fall through to the next translator, or
684 - delegate translation to the next translator by throwing a new type of exception. */
697 PyErr_SetString(PyExc_SystemError, "Exception escaped from default exception translator!");
1772 * Wrapper to generate a new Python exception type.
1779 class exception : public object {
1781 exception() = default;
1782 exception(handle scope, const char *name, PyObject *base = PyExc_Exception) {
1792 // Sets the current python exception to this exception object with the given message
1799 // Returns a reference to a function-local static exception object used in the simple
1803 exception<CppException> &get_exception_object() { static exception<CppException> ex; return ex; }
1807 * Registers a Python exception in `m` of the given `name` and installs an exception translator to
1808 * translate the C++ exception to the created Python exception using the exceptions what() method.
1809 * This is intended for simple exception translations; for more complex translation, register the
1810 * exception object and translator directly.
1813 exception<CppException> &register_exception(handle scope,
1817 if (!ex) ex = exception<CppException>(scope, name, base);