]> Creatis software - cpPlugins.git/blobdiff - lib/cpPipelineEditor/BaseQtMainWindow.cxx
...
[cpPlugins.git] / lib / cpPipelineEditor / BaseQtMainWindow.cxx
index cf5e41f32b07c686436283ff11e302be651892a2..e507f1926bb63128e7d013f61701eef4261344a3 100644 (file)
@@ -319,14 +319,39 @@ void cpPipelineEditor::BaseQtMainWindow::
 _ExecFilter( const std::string& filter_name )
 {
   this->_Block( );
-  std::string err = this->m_Workspace.Execute( filter_name );
-  this->_UnBlock( );
-  if( err != "" )
+  try
+  {
+    this->m_Workspace.Execute( filter_name );
+    this->_UnBlock( );
+  }
+  catch( itk::ExceptionObject& err1 )
+  {
     QMessageBox::critical(
       this,
       QMessageBox::tr( "Error executing filter" ),
-      QMessageBox::tr( err.c_str( ) )
+      QMessageBox::tr( err1.GetDescription( ) )
       );
+    this->_UnBlock( );
+  }
+  catch( std::exception& err2 )
+  {
+    QMessageBox::critical(
+      this,
+      QMessageBox::tr( "Error executing filter" ),
+      QMessageBox::tr( err2.what( ) )
+      );
+    this->_UnBlock( );
+  }
+  catch( ... )
+  {
+    QMessageBox::critical(
+      this,
+      QMessageBox::tr( "Error executing filter" ),
+      QMessageBox::tr( "Unknown error" )
+      );
+    this->_UnBlock( );
+
+  } // yrt
 }
 
 // eof - $RCSfile$