Changeset 19701


Ignore:
Timestamp:
11/09/15 17:53:05 (9 years ago)
Author:
Eric.Larour
Message:

CHG: no need for differentiated report functions!

Location:
issm/trunk-jpl/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp

    r17495 r19701  
    8080        return;
    8181}/*}}}*/
    82 const char* ErrorException::MatlabReport() const{/*{{{*/
     82const char* ErrorException::WrapperReport() const{/*{{{*/
    8383
    8484        /*Output*/
     
    100100        return message;
    101101}/*}}}*/
    102 const char* ErrorException::PythonReport() const{/*{{{*/
    103 
    104         /*Output*/
    105         std::ostringstream buffer;
    106         char *message = NULL;
    107 
    108         /*WINDOWS*/
    109         if(!function_name || file_line==0){
    110                 buffer << " error message: " << this->what_str;
    111         }
    112         else{
    113                 buffer << "\nError in ==> " << this->file_name << ":" << file_line << "\n";
    114                 buffer << this->function_name << " error message: " << this->what_str;
    115         }
    116 
    117         /*Convert std::ostringstream to std::string and then create char* */
    118         std::string buffer2 = buffer.str();
    119         message = xNew<char>(strlen(buffer2.c_str())+1); sprintf(message,"%s",buffer2.c_str());
    120         return message;
    121 }/*}}}*/
  • issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h

    r17513 r19701  
    8787        virtual const char *what() const throw();
    8888        void Report() const;
    89         const char* MatlabReport() const;
    90         const char* PythonReport() const;
     89        const char* WrapperReport() const;
    9190
    9291};
  • issm/trunk-jpl/src/wrappers/matlab/include/wrapper_macros.h

    r16230 r19701  
    2323#define MODULEEND(); }\
    2424        catch(ErrorException &exception){\
    25                 mexErrMsgTxt(exception.MatlabReport()); \
     25                mexErrMsgTxt(exception.WrapperReport()); \
    2626        }\
    2727        catch (exception &e){\
  • issm/trunk-jpl/src/wrappers/python/include/wrapper_macros.h

    r19054 r19701  
    2727#define MODULEEND(); }\
    2828  catch(ErrorException &exception){\
    29           PyErr_SetString(PyExc_TypeError,exception.PythonReport()); \
     29          PyErr_SetString(PyExc_TypeError,exception.WrapperReport()); \
    3030          return NULL;\
    3131  } \
Note: See TracChangeset for help on using the changeset viewer.