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

Throw more detail error on generation fail #193

Open
akoidan opened this issue May 8, 2018 · 1 comment
Open

Throw more detail error on generation fail #193

akoidan opened this issue May 8, 2018 · 1 comment

Comments

@akoidan
Copy link

akoidan commented May 8, 2018

Let's assume we have two giant classes: DtoPlan and Plan with a lot of fields. I want to map one class into another one. The first thing I would do is to create Interface and mark it with @Mapper annotation. This would produce the error below:

import DaggerAppInjector;
                                   ^
                                           symbol:   class DaggerAppInjector
  location: package dagger
        `PlansMapper.java:35: error: Failed to generate mapping method for type model.DtoPlan to model.Plan not supported on mappers.PlansMapper.toMovies(model.DtoPlan) !
        Plan toMovies(DtoPlan in);
        ^
        --> Add a custom mapper or 'withIgnoreFields' on @Mapper or @Maps to fix this ! If you think this a Bug in Selma please report issue here [https://github.com/xebia-france/selma/issues].

How would I know which one of hunded field produce the error above? Is there a way we can generate an Exception like can't map fieldA to fieldB because unsupported types found or smth?

@akoidan
Copy link
Author

akoidan commented May 8, 2018

Update:
In my particular case, I didn't receive any error because the output class didn't have a default constructor. Maybe we can add this info to the exception?

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