Skip to content

Commit 2a09127

Browse files
committed
Change Exception and Message
1 parent 54b1110 commit 2a09127

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.fasterxml.jackson.module.kotlin
22

3+
import com.fasterxml.jackson.databind.JsonMappingException
34
import com.fasterxml.jackson.databind.MapperFeature
45
import com.fasterxml.jackson.databind.module.SimpleModule
56
import com.fasterxml.jackson.module.kotlin.KotlinFeature.NullIsSameAsDefault
@@ -57,7 +58,10 @@ class KotlinModule @Deprecated(
5758
init {
5859
if (!KotlinVersion.CURRENT.isAtLeast(1, 5)) {
5960
// Kotlin 1.4 was deprecated when this process was introduced(jackson-module-kotlin 2.15).
60-
throw IllegalStateException("jackson-module-kotlin requires Kotlin 1.5 or higher.")
61+
throw JsonMappingException(
62+
null,
63+
"KotlinModule requires Kotlin version >= 1.5 - Found ${KotlinVersion.CURRENT}"
64+
)
6165
}
6266
}
6367

0 commit comments

Comments
 (0)