]> Creatis software - clitk.git/blobdiff - tools/clitkAutoCrop.cxx
error are now handled by exception
[clitk.git] / tools / clitkAutoCrop.cxx
index 93d0e01841cb85ed5a169945059ccf463b7d6e0e..e22fa6a6bfb23f6b8b169eba3d603eaef69a66ec 100644 (file)
@@ -33,10 +33,11 @@ int main(int argc, char * argv[])
   FilterType::Pointer filter = FilterType::New();
 
   filter->SetArgsInfo(args_info);
-  filter->Update();
 
-  if (filter->HasError()) {
-    std::cout << filter->GetLastError() << std::endl;
+  try {
+    filter->Update();
+  } catch(std::runtime_error e) {
+    std::cout << e.what() << std::endl;
   }
 
   return EXIT_SUCCESS;