Index: /issm/trunk-jpl/src/c/include/macros.h
===================================================================
--- /issm/trunk-jpl/src/c/include/macros.h	(revision 12077)
+++ /issm/trunk-jpl/src/c/include/macros.h	(revision 12078)
@@ -57,4 +57,7 @@
 		_printf_(true,"Standard exception: %s\n",e.what());\
 		return 1;\
+	}\
+	catch(...){\
+		_printf_(true,"An unexpected error occurred");\
 	}
 /*}}}*/
Index: /issm/trunk-jpl/src/c/matlab/include/matlab_macros.h
===================================================================
--- /issm/trunk-jpl/src/c/matlab/include/matlab_macros.h	(revision 12077)
+++ /issm/trunk-jpl/src/c/matlab/include/matlab_macros.h	(revision 12078)
@@ -20,4 +20,5 @@
  * MODULEBOOT(); and MODULEEND(); at the beginning and end of a module, and c++ exceptions 
  * will be trapped. Really nifty!*/
+//exception.Report(); 
 
 #define MODULEBOOT(); ModuleBoot(); \
@@ -26,10 +27,11 @@
 #define MODULEEND(); ModuleEnd(); }\
 	catch(ErrorException &exception){\
-		exception.Report(); \
-		mexErrMsgTxt(""); \
+		mexErrMsgTxt("ISSM Error"); \
 	}\
-	catch (exception& e) {\
-		_printf_(true,"Standard exception: %s\n",e.what());\
-		mexErrMsgTxt(" ");\
+	catch (exception &e){\
+		mexErrMsgTxt(exprintf("Standard exception: %s\n",e.what()));\
+	}\
+	catch(...){\
+		mexErrMsgTxt("An unexpected error occurred");\
 	}
 //}}}
Index: /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 12077)
+++ /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 12078)
@@ -29,4 +29,8 @@
 
 ErrorException::~ErrorException() throw(){
+	extern int num_procs;
+	/*We want the report only for matlab modules, otherwise we get twice the report
+	 * We assume that if num_procs==1, it is a module (FIXME)*/
+	if(num_procs==1) this->Report();
 }
 
@@ -37,4 +41,5 @@
 void ErrorException::Report(){
 	extern int my_rank;
+	extern int num_procs;
 
 	if (function_name=="" || file_line==0){ //WINDOWS
@@ -42,6 +47,12 @@
 	}
 	else{
-		printf("\n[%i] ??? Error using ==> %s:%i\n",my_rank,file_name.c_str(),file_line);
-		printf("[%i] %s error message: %s\n\n",my_rank,function_name.c_str(),what());
+		if(num_procs==1){
+			printf("\n??? Error using ==> %s:%i\n",file_name.c_str(),file_line);
+			printf("%s error message: %s\n\n",function_name.c_str(),what());
+		}
+		else{
+			printf("\n[%i] ??? Error using ==> %s:%i\n",my_rank,file_name.c_str(),file_line);
+			printf("[%i] %s error message: %s\n\n",my_rank,function_name.c_str(),what());
+		}
 	}
 	return;
Index: /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h	(revision 12077)
+++ /issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h	(revision 12078)
@@ -17,4 +17,6 @@
 class ErrorException: public exception {
 	
+	public:
+
 	string   what_str;
 	string   function_name;
@@ -22,12 +24,9 @@
 	int      file_line;
 
-	public:
 
 	ErrorException(const string &what_arg); //for windows
 	ErrorException(string what_file,string what_function,int what_line,string what_arg);//UNIX
 	~ErrorException() throw();
-
 	virtual const char *what() const throw();
-
 	void Report();
 
