]> 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 76e9179a825f4cf4905ff21dd9a73741270974bc..6f602cd295cb8e64bf7be2f60c8879fda65fc370 100644 (file)
@@ -29,6 +29,7 @@ SET(clitkCommon_SRC
   clitkOrientation.cxx
   vvImage.cxx
   clitkImageToImageGenericFilterBase.cxx
+  clitkExceptionObject.cxx
   clitkFilterBase.cxx
 )  
 
index 2f1cdee71f027c59b7da4d8901d5e52b2818dc47..dc5be12b62d53c7689c0f3e4039f440250882c1d 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;