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

Class MyException2

tests/test_exceptions.cpp:35–42  ·  view source on GitHub ↗

A type that should be translated to a standard Python exception

Source from the content-addressed store, hash-verified

33
34// A type that should be translated to a standard Python exception
35class MyException2 : public std::exception {
36public:
37 explicit MyException2(const char *m) : message{m} {}
38 const char *what() const noexcept override { return message.c_str(); }
39
40private:
41 std::string message = "";
42};
43
44// A type that is not derived from std::exception (and is thus unknown)
45class MyException3 {

Callers 1

TEST_SUBMODULEFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_SUBMODULEFunction · 0.68