source: issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h@ 13701

Last change on this file since 13701 was 13701, checked in by Mathieu Morlighem, 12 years ago

Better handling of matlab and python errors by putting error message directoy in mexErrTxt
Got rid of c/matlab/io/PrintfFunction.cpp
Initialize IssmComm for modules as -1 so that my_rank and num_proc are still defined

File size: 1018 bytes
Line 
1/*!\file exceptions.h
2 * \brief: two types of exceptions are handled for now. Errors, and
3 * warnings. Those exceptions are trapped provided the matlab modules
4 * are started using MODULEBOOT, and ended using MODULEEND. These are
5 * macros hiding try, catch statements. This header file defines our
6 * own exceptions
7 */
8
9#ifndef MY_EXCEPTIONS_H_
10#define MY_EXCEPTIONS_H_
11
12#include <exception>
13#include <string>
14using namespace std;
15
16/*We derive our classes from the c++ exception class: */
17class ErrorException: public exception {
18
19 string what_str;
20 string function_name;
21 string file_name;
22 int file_line;
23
24 public:
25 ErrorException(const string &what_arg); //for windows
26 ErrorException(const string& what_file,const string& what_function,int what_line,const string& what_arg);//UNIX
27 ~ErrorException() throw();
28 virtual const char *what() const throw();
29 void Report() const;
30 const char* MatlabReport() const;
31 const char* PythonReport() const;
32
33};
34
35char* exprintf(const char* format,...);
36#endif
Note: See TracBrowser for help on using the repository browser.