From: bourcier Date: Tue, 6 Aug 2013 06:51:29 +0000 (+0000) Subject: raise PreCAD errors as Compute errors and retrieve warning messages related to licens... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=749d5533ac5c2e2ab6f7a657b19ebcae469e7624;p=plugins%2Fblsurfplugin.git raise PreCAD errors as Compute errors and retrieve warning messages related to license and periodicity --- diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index 067cda4..c7b098b 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -2610,8 +2610,22 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh& aMesh, if(status != STATUS_OK){ // TODO: raise an error if status < 0. cout << "================ WARNING =================== \n"; - cout << "PreCAD processing failed with error code " << status << "\n"; + stringstream msg; + msg << "PreCAD processing failed with error code " << status << "\n"; + msg << *mcud._error; + cout << msg.str(); cout << "============================================ \n"; + // the text of _comment is set in message_cb by mcud->_error + // => No need to append msg to _comment + if (status > 0) + { + // TODO: fix the SIGSEGV of COMPERR_WARNING with 2 launches + error(COMPERR_WARNING, _comment); + } + if (status < 0) + { + error(_comment); + } } else { // retrieve the pre-processed CAD object @@ -3324,7 +3338,8 @@ status_t message_cb(message_t *msg, void *user_data) message_get_description(msg, &desc); string err( desc ); message_cb_user_data * mcud = (message_cb_user_data*)user_data; - if ( errnumber < 0 || err.find("license") != string::npos ) { + // Get all the error message and some warning messages related to license and periodicity + if ( errnumber < 0 || err.find("license") != string::npos || err.find("periodicity") != string::npos ) { // remove ^A from the tail int len = strlen( desc ); while (len > 0 && desc[len-1] != '\n')