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

Improve error msg for PropertyMappingNotExistingException #83

Open
MV-GH opened this issue Jun 23, 2024 · 0 comments
Open

Improve error msg for PropertyMappingNotExistingException #83

MV-GH opened this issue Jun 23, 2024 · 0 comments

Comments

@MV-GH
Copy link

MV-GH commented Jun 23, 2024

Currently it is quite hard to find which mapping is throwing this exception.

For example

[ksp] io.mcarle.konvert.processor.exceptions.PropertyMappingNotExistingException: No property for valueParameter=banned_from_community existing in [PropertyMappingInfo(mappingParamName=d, sourceName=comment, targetName=comment, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=comment), isBasedOnAnnotation=false), PropertyMappingInfo(mappingParamName=d, sourceName=comment_reply, targetName=comment_reply, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=comment_reply), isBasedOnAnnotation=false), PropertyMappingInfo(mappingParamName=d, sourceName=community, targetName=community, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=community), isBasedOnAnnotation=false), PropertyMappingInfo(mappingParamName=d, sourceName=counts, targetName=counts, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=counts), isBasedOnAnnotation=false), PropertyMappingInfo(mappingParamName=d, sourceName=creator, targetName=creator, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=creator), isBasedOnAnnotation=false), PropertyMappingInfo(mappingParamName=d, sourceName=creator_banned_from_community, targetName=creator_banned_from_community, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=creator_banned_from_community), isBasedOnAnnotation=false), PropertyMappingInfo(mappingParamName=d, sourceName=creator_blocked, targetName=creator_blocked, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=creator_blocked), isBasedOnAnnotation=false), PropertyMappingInfo(mappingParamName=d, sourceName=my_vote, targetName=my_vote, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=my_vote), isBasedOnAnnotation=false), PropertyMappingInfo(mappingParamName=d, sourceName=post, targetName=post, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=post), isBasedOnAnnotation=false), PropertyMappingInfo(mappingParamName=d, sourceName=recipient, targetName=recipient, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=recipient), isBasedOnAnnotation=false), PropertyMappingInfo(mappingParamName=d, sourceName=saved, targetName=saved, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=saved), isBasedOnAnnotation=false), PropertyMappingInfo(mappingParamName=d, sourceName=subscribed, targetName=subscribed, constant=null, expression=null, ignore=false, enableConverters=[], sourceData=SourceProperty(property=subscribed), isBasedOnAnnotation=false)]
	at io.mcarle.konvert.processor.codegen.CodeGenerator.verifyPropertiesAndMandatoryParametersExist(CodeGenerator.kt:131)
	at io.mcarle.konvert.processor.codegen.CodeGenerator.generateCode(CodeGenerator.kt:73)
	at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator.generateMappingCode(KonverterCodeGenerator.kt:110)
	at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator.access$generateMappingCode(KonverterCodeGenerator.kt:22)
	at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator$generate$1$1$1$1.invoke(KonverterCodeGenerator.kt:75)
	at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator$generate$1$1$1$1.invoke(KonverterCodeGenerator.kt:40)
	at io.mcarle.konvert.converter.api.config.ConfigurationKt.withIsolatedConfiguration(Configuration.kt:54)
	at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator$generate$1.invoke(KonverterCodeGenerator.kt:40)

I have to look quite a while from the thousand mappings I have to find one which is throwing this.

i would like to see

banned_from_community field missing at Mapping FQDN.Person.banned_from_community to FQDN2.Person

mcarleio added a commit that referenced this issue Jul 2, 2024
This is a first easy step by catching exceptions during code generation and throw a KonvertException which contain basic information which might be missing in the original 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