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

Better error message for missing half of an adapter #59

Closed
JakeWharton opened this issue Jun 17, 2015 · 0 comments
Closed

Better error message for missing half of an adapter #59

JakeWharton opened this issue Jun 17, 2015 · 0 comments

Comments

@JakeWharton
Copy link
Member

Given

class AnInterfaceAdapter {
  @ToJson String to(AnInterface ai) {
    return "an_interface";
  }
}
Moshi moshi = new Moshi.Builder()
    .add(new AnInterfaceAdapter())
    .build();
moshi.adapter(AnInterface.class);

An error message is thrown saying no adapter could be found for AnInterface. This is not strictly true and misleading, the problem is that only a "to" adapter could be found but no "from" adapter. We should report a better error message.

swankjesse added a commit that referenced this issue Jun 21, 2015
swankjesse added a commit that referenced this issue Jun 21, 2015
swankjesse added a commit that referenced this issue Jun 21, 2015
murillorodney62 added a commit to murillorodney62/kotlin-codegen-android that referenced this issue 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

No branches or pull requests

1 participant