Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report what exception is before re-throwing #66

Closed
fedorov opened this issue Sep 19, 2013 · 3 comments
Closed

Report what exception is before re-throwing #66

fedorov opened this issue Sep 19, 2013 · 3 comments

Comments

@fedorov
Copy link
Contributor

fedorov commented Sep 19, 2013

Currently, exception is not caught, and the user get this cryptic error message when output file cannot be created:

libc++abi.dylib: terminate called throwing an exception

Here is the fix:

--- a/BRAINSCommonLib/GenericTransformImage.cxx
+++ b/BRAINSCommonLib/GenericTransformImage.cxx
@@ -206,6 +206,7 @@ int WriteBothTransformsToDisk(const GenericTransformType::ConstPointer genericTr
     }
   catch( itk::ExceptionObject & excp )
     {
+    std::cout << "Exception: " << excp << std::endl;
     throw excp; // reohrow exception, handle in some other scope.
     }
   return 0;

I tried to create a pull request, but I am unable to commit the change (to my own git fork!), because of this error message: "Your work tree has not been configured for development." Running ITK_DIR/Utilities/SetupForDevelopment.sh does not fix this error. Can you tell me how to fix this?

@hjmjohnson
Copy link
Member

In the main directory tree in

BRAINSTools/Utilities/SetupForDevelopment.sh

This needs to be run to get the git hooks to maintain consistent code put
into place.

Hans

From: Andrey Fedorov notifications@github.com
Reply-To: BRAINSia/BRAINSTools
<reply+i-19761051-445d859eb2fe8896b708c09a57637c4bbc6dab09-313970@reply.gith
ub.com>
Date: Thursday, September 19, 2013 10:15 AM
To: BRAINSia/BRAINSTools BRAINSTools@noreply.github.com
Subject: [BRAINSTools] Report what exception is before re-throwing (#66)

Currently, exception is not caught, and the user get this cryptic error
message when output file cannot be created:

libc++abi.dylib: terminate called throwing an exception

Here is the fix:

--- a/BRAINSCommonLib/GenericTransformImage.cxx
+++ b/BRAINSCommonLib/GenericTransformImage.cxx
@@ -206,6 +206,7 @@ int WriteBothTransformsToDisk(const
GenericTransformType::ConstPointer genericTr
}
catch( itk::ExceptionObject & excp )
{

  • std::cout << "Exception: " << excp << std::endl; throw excp; // reohrow
    exception, handle in some other scope. } return 0;
    I tried to create a pull request, but I am unable to commit the change (to
    my own git fork!), because of this error message: "Your work tree has not
    been configured for development." Running
    ITK_DIR/Utilities/SetupForDevelopment.sh does not fix this error. Can you
    tell me how to fix this?


Reply to this email directly or view it on GitHub
#66 .

@fedorov
Copy link
Contributor Author

fedorov commented Sep 19, 2013

Got it. Thanks. I will submit a pull request.

fedorov added a commit to fedorov/BRAINSTools that referenced this issue Sep 19, 2013
hjmjohnson pushed a commit that referenced this issue Dec 31, 2013
@hjmjohnson
Copy link
Member

@fedorov I just committed this on the main branch under commit id 58f2ee8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants