mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
translate netgen-exception to python
This commit is contained in:
parent
457c2ad96d
commit
7cbdcf29cf
@ -39,6 +39,11 @@ void ExportArray ()
|
||||
;
|
||||
}
|
||||
|
||||
void TranslateException (const NgException & ex)
|
||||
{
|
||||
string err = string("Netgen exception: ")+ex.What();
|
||||
PyErr_SetString(PyExc_RuntimeError, err.c_str());
|
||||
}
|
||||
|
||||
|
||||
DLL_HEADER void ExportNetgenMeshing()
|
||||
@ -46,6 +51,8 @@ DLL_HEADER void ExportNetgenMeshing()
|
||||
|
||||
ModuleScope module("meshing");
|
||||
|
||||
bp::register_exception_translator<NgException>(&TranslateException);
|
||||
|
||||
bp::class_<PointIndex>("PointId", bp::init<int>())
|
||||
.def("__repr__", &ToString<PointIndex>)
|
||||
.def("__str__", &ToString<PointIndex>)
|
||||
|
Loading…
Reference in New Issue
Block a user