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
InvocationFactory.createInvocation's realmethod cannot throw a Throwable #1306
Comments
moltmann
added a commit
to moltmann/mockito
that referenced
this issue
Feb 6, 2018
A real method might throw a Throwable, but the invocations produced by InvocationFactory call the real method via a Callable that can only throw a Exception. Hence add a new method to InvocationFactory that allows to create invocations with a RealMethodBehavior == a Callable that throws a Throwable.
moltmann
added a commit
to moltmann/mockito
that referenced
this issue
Feb 6, 2018
A real method might throw a Throwable, but the invocations produced by InvocationFactory call the real method via a Callable that can only throw a Exception. Hence add a new method to InvocationFactory that allows to create invocations with a RealMethodBehavior == a Callable that throws a Throwable.
moltmann
added a commit
to moltmann/mockito
that referenced
this issue
Feb 6, 2018
A real method might throw a Throwable, but the invocations produced by InvocationFactory call the real method via a Callable that can only throw a Exception. Hence add a new method to InvocationFactory that allows to create invocations with a RealMethodBehavior == a Callable that throws a Throwable.
moltmann
added a commit
to moltmann/mockito
that referenced
this issue
Feb 6, 2018
A real method might throw a Throwable, but the invocations produced by InvocationFactory call the real method via a Callable that can only throw a Exception. Hence add a new method to InvocationFactory that allows to create invocations with a RealMethodBehavior == a Callable that throws a Throwable.
mockitoguy
added a commit
that referenced
this issue
Feb 9, 2018
Fixes #1306: Invocation's real method throws Throwable
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
InvocationFactory.createInvocation takes a Callable that is used to call the real method of the Invocation. If the Invocation throws an Exception the Exception is forwarded from the Callable. Unfortunately Callable can only throw an Exception, not a Throwable.
Hence if the real method throws a Throwable that is neither an Error, RuntimeException or Exception it cannot be forwarded.
I recommend for InvocationFactory.createInvocation to take realMethod argument that can throw a full Throwable.
This is required for fixing: linkedin/dexmaker#64
The text was updated successfully, but these errors were encountered: