]> Creatis software - cpPlugins.git/blobdiff - appli/examples/plugins/example_ReadWriteImageWithWorkspace.cxx
...
[cpPlugins.git] / appli / examples / plugins / example_ReadWriteImageWithWorkspace.cxx
index 630744ac3df7297d4dcbc43d1a4489ec124d5dde..cba679390f607b91cb5daf4c202dc75c7d9007aa 100644 (file)
@@ -45,8 +45,11 @@ int main( int argc, char* argv[] )
   writer_params->SetSaveFileName( "FileName", argv[ argc - 1 ] );
 
   // Execute
-  std::string err = workspace.Execute( );
-  if( err != "" )
+  try
+  {
+    workspace.Execute( );
+  }
+  catch( itk::ExceptionObject& err )
   {
     std::cout << "Error caught: " << err << std::endl;
     ret = 1;