Index: /issm/trunk-jpl/src/c/python/include/python_macros.h
===================================================================
--- /issm/trunk-jpl/src/c/python/include/python_macros.h	(revision 13362)
+++ /issm/trunk-jpl/src/c/python/include/python_macros.h	(revision 13363)
@@ -20,12 +20,22 @@
 /*The following macros hide the error exception handling in a matlab module. Just put 
  * MODULEBOOT(); and MODULEEND(); at the beginning and end of a module, and c++ exceptions 
- * will be trapped. Really nifty!*/
+ * will be trapped*/
+#define MODULEBOOT(); \
+	PyObject *output = PyTuple_New(NLHS);        \
+	int       nrhs   = (int)PyTuple_Size(args);  \
+	if(!output) return NULL;\
+	 try{ \
 
-#define MODULEBOOT(); ModuleBoot();  \
-	PyObject* output = PyTuple_New(NLHS); if (!output) return NULL;\
-			int nrhs = (int)PyTuple_Size(args);
-
-#define MODULEEND();  ModuleEnd(); \
-						 return output;
+#define MODULEEND(); }\
+  catch(ErrorException &exception){\
+	  PyErr_SetString(PyExc_TypeError,"ISSM Error"); \
+  } \
+	catch (exception &e){\
+		PyErr_SetString(PyExc_TypeError,exprintf("Standard exception: %s\n",e.what()));\
+	}\
+	catch(...){\
+		PyErr_SetString(PyExc_TypeError,"An unexpected error occurred");\
+	}\
+	return output;
 //}}}
 #if _PYTHON_MAJOR_ >=3
Index: /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 13362)
+++ /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 13363)
@@ -39,5 +39,5 @@
 }
 
-void ErrorException::Report(){
+void ErrorException::Report() const{
 	extern int my_rank;
 	extern int num_procs;
Index: /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h	(revision 13362)
+++ /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h	(revision 13363)
@@ -27,5 +27,5 @@
 	~ErrorException() throw();
 	virtual const char *what() const throw();
-	void Report();
+	void Report() const;
 
 };
Index: /issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp	(revision 13362)
+++ /issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp	(revision 13363)
@@ -255,12 +255,12 @@
 	int el1,el2;
 
-	double* segments=NULL;
-	double*    segmentmarkerlist=NULL;
+	double *segments          = NULL;
+	double *segmentmarkerlist = NULL;
 	int     nsegs;
 
 	/*Recover input: */
-	segments=*psegments;
-	segmentmarkerlist=*psegmentmarkerlist;
-	nsegs=*pnsegs;
+	segments          = *psegments;
+	segmentmarkerlist = *psegmentmarkerlist;
+	nsegs             = *pnsegs;
 
 	/*Reallocate segments: */
