From 1ad955c1be07763bfa07d0a00e8a421807357385 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Mon, 4 Oct 2010 07:47:46 +0000 Subject: [PATCH] add exception file --- common/CMakeLists.txt | 1 + tools/clitkBinarizeImage.cxx | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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; -- 2.47.1