From: dsarrut Date: Mon, 4 Oct 2010 07:47:46 +0000 (+0000) Subject: add exception file X-Git-Tag: v1.2.0~375 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1ad955c1be07763bfa07d0a00e8a421807357385;p=clitk.git add exception file --- diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 76e9179..6f602cd 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -29,6 +29,7 @@ SET(clitkCommon_SRC clitkOrientation.cxx vvImage.cxx clitkImageToImageGenericFilterBase.cxx + clitkExceptionObject.cxx clitkFilterBase.cxx ) diff --git a/tools/clitkBinarizeImage.cxx b/tools/clitkBinarizeImage.cxx index 2f1cdee..dc5be12 100644 --- a/tools/clitkBinarizeImage.cxx +++ b/tools/clitkBinarizeImage.cxx @@ -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;