MCPcopy Create free account
hub / github.com/SimVascular/SimVascular / PyUtilGetPyErrorInfo

Function PyUtilGetPyErrorInfo

Code/Source/PythonAPI/PyUtils.cxx:110–118  ·  view source on GitHub ↗

---------------------- PyUtilGetPyErrorInfo ---------------------- Get the error and name of an item that has generated PyError.

Source from the content-addressed store, hash-verified

108// Get the error and name of an item that has generated PyError.
109//
110void PyUtilGetPyErrorInfo(PyObject* item, std::string& errorMsg, std::string& itemStr)
111{
112 PyObject *ptype, *pvalue, *ptraceback;
113 PyErr_Fetch(&ptype, &pvalue, &ptraceback);
114 auto pystr = PyObject_Str(pvalue);
115 errorMsg = std::string(PyString_AsString(pystr));
116 auto itemRep = PyObject_Repr(item);
117 itemStr = std::string(PyString_AsString(itemRep));
118}
119
120//--------------------------
121// SvPyUtilGetFunctionName

Callers 7

Geom_local_blendFunction · 0.85
PyUtilGetDoubleAttrFunction · 0.85
PyUtilGetIntAttrFunction · 0.85
PyUtilGetStringAttrFunction · 0.85
PyUtilGetStringListAttrFunction · 0.85
GenerateLocalSizeArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected