Skip to content

Conversation

@neofreko
Copy link

@neofreko neofreko commented Oct 3, 2022

When automation test fail, graphwalker will always show: java.lang.reflect.InvocationTargetException. This makes debugging difficult as we have to rely on log message to see where the code fail -- often with guessing.

This small PR will attach the root cause instead of graphwalker local exception.

Given the following implementation:
image

Before:

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.graphwalker.core.machine.ExecutionContext.execute(ExecutionContext.java:277)

After:

java.lang.RuntimeException
	at org.graphwalker.java.test.TestExecutorTest$ThrowExceptionTest.throwException(TestExecutorTest.java:188)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.graphwalker.core.machine.ExecutionContext.execute(ExecutionContext.java:277)

@KristianKarl
Copy link
Contributor

Thank you @neofreko 👍

@KristianKarl KristianKarl merged commit b0640f7 into GraphWalker:master Oct 12, 2022
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

Successfully merging this pull request may close these issues.

3 participants