Add a utility method
diff --git a/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java b/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java
index 7fa53d3..6c7474e 100644
--- a/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java
+++ b/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java
@@ -863,6 +863,17 @@
public JsonMappingException mappingException(String message) {
return JsonMappingException.from(getParser(), message);
}
+
+ /**
+ * Helper method for constructing generic mapping exception with specified
+ * message and current location information
+ *
+ * @since 2.6
+ */
+ public JsonMappingException mappingException(String msgTemplate, Object... args) {
+ String message = String.format(msgTemplate, args);
+ return JsonMappingException.from(getParser(), message);
+ }
/**
* Helper method for constructing instantiation exception for specified type,