]> Creatis software - clitk.git/commitdiff
add exception file
authordsarrut <dsarrut>
Mon, 4 Oct 2010 07:47:46 +0000 (07:47 +0000)
committerdsarrut <dsarrut>
Mon, 4 Oct 2010 07:47:46 +0000 (07:47 +0000)
common/CMakeLists.txt
tools/clitkBinarizeImage.cxx

index 76e9179..6f602cd 100644 (file)
@@ -29,6 +29,7 @@ SET(clitkCommon_SRC
   clitkOrientation.cxx
   vvImage.cxx
   clitkImageToImageGenericFilterBase.cxx
+  clitkExceptionObject.cxx
   clitkFilterBase.cxx
 )  
 
index 2f1cdee..dc5be12 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;