File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/main/kotlin/com/fasterxml/jackson/module/kotlin Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,13 @@ inline fun <reified T> Any?.checkTypeMismatch(): T {
5959 // Since this can be caused by both input or ObjectMapper implementation errors,
6060 // a more abstract RuntimeJsonMappingException is thrown.
6161 if (this !is T ) {
62+ val nullability = if (null is T ) " ?" else " (non-null)"
63+
6264 // Since the databind implementation of MappingIterator throws RuntimeJsonMappingException,
6365 // JsonMappingException was not used to unify the behavior.
6466 throw RuntimeJsonMappingException (
6567 " Deserialized value did not match the specified type; " +
66- " specified ${T ::class .qualifiedName} but was ${this ?.let { it::class .qualifiedName }} "
68+ " specified ${T ::class .qualifiedName}${nullability} but was ${this ?.let { it::class .qualifiedName }} "
6769 )
6870 }
6971 return this
You can’t perform that action at this time.
0 commit comments