]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkInterpreter.cxx
are now generated in user's .bbtk dir
[bbtk.git] / kernel / src / bbtkInterpreter.cxx
index 0bb789483e372f35b596a5e87f28c034a660770c..afa23734826a312b2370d74f6d98ff5fca0a5650 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/12/15 09:04:47 $
-  Version:   $Revision: 1.81 $
+  Date:      $Date: 2009/01/27 14:22:57 $
+  Version:   $Revision: 1.82 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -421,6 +421,14 @@ namespace bbtk
   //=======================================================================
   void Interpreter::CatchInterpreterException( const InterpreterException& e )
   {
+    if (GetExecuter()->GetNoErrorMode()) 
+      {
+       bbtkWarning("ERROR :"<<e.GetErrorMessage()
+                   <<" ("<<e.GetScriptFile()<<":"<<e.GetScriptLine()
+                   <<" skipped");
+
+       return;
+      }
     if (mThrow) 
       {
        if (e.GetErrorMessage()!="break")
@@ -448,6 +456,19 @@ namespace bbtk
   //=======================================================================
   void Interpreter::CatchBbtkException( const bbtk::Exception& e )
   {
+    if (GetExecuter()->GetNoErrorMode()) 
+      {
+       std::string file("?");
+       int line = 0;
+       if (mFileName.size()) {
+         file = mFileName.back();
+         line = mLine.back();
+       }    
+       bbtkWarning("ERROR '"<<e.GetErrorMessage()
+                   <<"' ("<<file<<":"<<line<<") skipped");
+       
+       return;
+      }
     mStatus = Interpreter_ERROR;              
     if (mThrow) 
       {
@@ -481,6 +502,19 @@ namespace bbtk
   //=======================================================================
   void Interpreter::CatchStdException( const std::exception& e )
   {  
+   if (GetExecuter()->GetNoErrorMode()) 
+      {
+       std::string file("?");
+       int line = 0;
+       if (mFileName.size()) {
+         file = mFileName.back();
+         line = mLine.back();
+       }    
+       bbtkWarning("ERROR '"<<e.what()
+                   <<"' ("<<file<<":"<<line<<") skipped");
+
+       return;
+      }
     mStatus = Interpreter_ERROR;              
     if (mThrow) 
       {
@@ -513,6 +547,18 @@ namespace bbtk
   //=======================================================================
   void Interpreter::CatchUnknownException()
   {
+   if (GetExecuter()->GetNoErrorMode()) 
+      {
+       std::string file("?");
+       int line = 0;
+       if (mFileName.size()) {
+         file = mFileName.back();
+         line = mLine.back();
+       }  
+       bbtkWarning("UNDEFINED ERROR "
+                   <<"("<<file<<":"<<line<<") skipped");
+       return;
+      }
     mStatus = Interpreter_ERROR;              
     if (mThrow) 
       {
@@ -850,7 +896,7 @@ namespace bbtk
            mVirtualExecuter->SetNoExecMode(true);
            mThrow = false;
          }
-       else if (words[1]=="freeze_no_error ") 
+       else if (words[1]=="freeze_no_error") 
          {
            mVirtualExecuter->SetNoExecMode(true);
            mVirtualExecuter->SetNoErrorMode(true);