Closed YasserRabee closed 1 year ago
Yeah, this is currently unsupported, but it would be a good addition. Currently, this can't be easily implemented, because the method that handles the mapExtend has no access to the error returning functionality that already exists.
I'm happy to contribute just need some guidance. I tried to implement but things got out of control quickly.
I don't have a clear solution in mind, because it's not that easy to implement. I'll have to try out some solutions to find out what's best.
Is your feature request related to a problem? Please describe.
We use mapExtend to map two fields from the source type to a single field in the target. Applying this mapping can return an error and it should be propagated back to the main convert method.
goverter prohibits returning multiple values from mapExtend functions with error
xx has no or too many returns
Describe the solution you'd like A clear and concise description of what you want to happen.
Support returning errors the same as
goverter:extend
Describe alternatives you've considered
We didn't find a possible alternative to use goverter in that scenario. We tried multiple solutions that all do the parsing outside goverter. While it was possible, we missed the best part of having everything generated automatically.