MCPcopy Create free account
hub / github.com/chokkan/crfsuite / UnknownExceptionHandler

Class UnknownExceptionHandler

swig/python/export_wrap.cpp:3172–3212  ·  view source on GitHub ↗

unknown exception handler */

Source from the content-addressed store, hash-verified

3170
3171 /* unknown exception handler */
3172 class UnknownExceptionHandler
3173 {
3174#ifdef SWIG_DIRECTOR_UEH
3175 static void handler() {
3176 try {
3177 throw;
3178 } catch (DirectorException& e) {
3179 std::cerr << "SWIG Director exception caught:" << std::endl
3180 << e.getMessage() << std::endl;
3181 } catch (std::exception& e) {
3182 std::cerr << "std::exception caught: "<< e.what() << std::endl;
3183 } catch (...) {
3184 std::cerr << "Unknown exception caught." << std::endl;
3185 }
3186
3187 std::cerr << std::endl
3188 << "Python interpreter traceback:" << std::endl;
3189 PyErr_Print();
3190 std::cerr << std::endl;
3191
3192 std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl
3193 << "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl
3194 << std::endl
3195 << "Exception is being re-thrown, program will like abort/terminate." << std::endl;
3196 throw;
3197 }
3198
3199 public:
3200
3201 std::unexpected_handler old;
3202 UnknownExceptionHandler(std::unexpected_handler nh = handler)
3203 {
3204 old = std::set_unexpected(nh);
3205 }
3206
3207 ~UnknownExceptionHandler()
3208 {
3209 std::set_unexpected(old);
3210 }
3211#endif
3212 };
3213
3214 /* type mismatch in the return value from a python method call */
3215 class DirectorTypeMismatchException : public Swig::DirectorException {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected