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;