publicissapient-france/selma

Throw more detail error on generation fail

akoidan opened this issue · 1 comments

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?

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?