better failure message if a type parser is not found with dynamic tempaltes
This commit is contained in:
parent
e3a9f3beb7
commit
3f4eea469c
|
@ -207,7 +207,12 @@ public class RootObjectMapper extends ObjectMapper {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Mapper.TypeParser.ParserContext parserContext = context.docMapperParser().parserContext();
|
Mapper.TypeParser.ParserContext parserContext = context.docMapperParser().parserContext();
|
||||||
return parserContext.typeParser(dynamicTemplate.mappingType(dynamicType)).parse(name, dynamicTemplate.mappingForName(name, dynamicType), parserContext);
|
String mappingType = dynamicTemplate.mappingType(dynamicType);
|
||||||
|
Mapper.TypeParser typeParser = parserContext.typeParser(mappingType);
|
||||||
|
if (typeParser == null) {
|
||||||
|
throw new MapperParsingException("failed to find type parsed [" + mappingType + "] for [" + name + "]");
|
||||||
|
}
|
||||||
|
return typeParser.parse(name, dynamicTemplate.mappingForName(name, mappingType), parserContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DynamicTemplate findTemplate(ContentPath path, String name, String dynamicType) {
|
public DynamicTemplate findTemplate(ContentPath path, String name, String dynamicType) {
|
||||||
|
|
Loading…
Reference in New Issue