]> Creatis software - cpPlugins.git/blobdiff - appli/examples/plugins/example_ReadWriteImage.cxx
...
[cpPlugins.git] / appli / examples / plugins / example_ReadWriteImage.cxx
index 3eb89d82fb0d6531448b57aa3675ed779f6212f8..e327074b3ee9570d22b8a9e7dfed30d97f2c6362 100644 (file)
@@ -78,8 +78,11 @@ int main( int argc, char* argv[] )
     writer->SetInput( "Input", reader->GetOutput( "Output" ) );
 
     // Execute filters
-    std::string err = writer->Update( );
-    if( err != "" )
+    try
+    {
+      writer->Update( );
+    }
+    catch( itk::ExceptionObject& err )
     {
       std::cout << "Error caught: " << err << std::endl;
       ret = 1;