-
Notifications
You must be signed in to change notification settings - Fork 649
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
AnnotationSpec throwing java.lang.reflect.InvocationTargetException instead of User Exception #539
Comments
I just discovered this isn't actually related to Should we point it to 3.2.0 anyways, @sksamuel ? |
LeoColman
added a commit
that referenced
this issue
Jan 11, 2019
When a test fails from an AnnotationSpec, it was wrapped in an InvocationTargetException, due to it being called via reflection. Because of it, the test failure stacktrace was confusing, as it wouldn't display user's exception directly. As explained in https://stackoverflow.com/questions/6020719/what-could-cause-java-lang-reflect-invocationtargetexception , this commit attempts to unwrap an exception if it's thrown by a reflection call context, by returning it's cause instead. Fixes #539
Yeah can put it on 3.2.0 unless someone asks for it on 3.1 |
I meant if this should go for 3.2 or 3.3, as it's unrelated to 3.2 |
Yes it's a bug and we've not yet released 3.2.0 so definitely target that. |
sksamuel
pushed a commit
that referenced
this issue
Jan 11, 2019
When a test fails from an AnnotationSpec, it was wrapped in an InvocationTargetException, due to it being called via reflection. Because of it, the test failure stacktrace was confusing, as it wouldn't display user's exception directly. As explained in https://stackoverflow.com/questions/6020719/what-could-cause-java-lang-reflect-invocationtargetexception , this commit attempts to unwrap an exception if it's thrown by a reflection call context, by returning it's cause instead. Fixes #539
LeoColman
added a commit
that referenced
this issue
Jan 11, 2019
LeoColman
added a commit
that referenced
this issue
Jan 11, 2019
LeoColman
added a commit
that referenced
this issue
Jan 11, 2019
When a test fails from an AnnotationSpec, it was wrapped in an InvocationTargetException, due to it being called via reflection. Because of it, the test failure stacktrace was confusing, as it wouldn't display user's exception directly. As explained in https://stackoverflow.com/questions/6020719/what-could-cause-java-lang-reflect-invocationtargetexception , this commit attempts to unwrap an exception if it's thrown by a reflection call context, by returning it's cause instead. Fixes #539
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When executing a test with AnnotationSpec:
I expected the stacktrace to contain my exception and my line at the top, but instead it returns a weird Stacktrace.
This happened after changing it's execution to
invokeSuspend
The text was updated successfully, but these errors were encountered: