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

add throwable type adapter #458

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

groov1kk
Copy link

Hey!

When trying to run tests from an IDE using the JUnit runner in a hybrid Kotlin/Java project (for example, in case if a project uses this template) I get errors like:

java.lang.IllegalArgumentException: Unable to create converter for class com.intellij.remoterobot.client.RetrieveResponse
    for method IdeRobotApi.screenshot

Caused by: com.google.gson.JsonIOException: Failed making field 'java.lang.Throwable#detailMessage' accessible; either increase its visibility or write a custom TypeAdapter for its declaring type.

This happens because of the difference between java.lang.Throwable and kotlin.Throwable which Robot framework is using in his API model, as the Java version of Throwable type also contains hidden members. Actually, Gson does not contain ThrowableTypeAdapter out of the box and does not know how to deserialize this type, as it was mention here.

So, adding a ThrowableTypeAdapter explicetly may solve this issue.

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.

1 participant