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
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')