diff options
Diffstat (limited to 'src/main/scala/spray/json/ProductFormats.scala')
-rw-r--r-- | src/main/scala/spray/json/ProductFormats.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/scala/spray/json/ProductFormats.scala b/src/main/scala/spray/json/ProductFormats.scala index 9914b55..9e494ff 100644 --- a/src/main/scala/spray/json/ProductFormats.scala +++ b/src/main/scala/spray/json/ProductFormats.scala @@ -56,9 +56,11 @@ trait ProductFormats extends ProductFormatsInstances { try reader.read(x.fields(fieldName)) catch { case e: NoSuchElementException => - deserializationError("Object is missing required member '" + fieldName + "'", e) + deserializationError("Object is missing required member '" + fieldName + "'", e, fieldName :: Nil) + case DeserializationException(msg, cause, fieldNames) => + deserializationError(msg, cause, fieldName :: fieldNames) } - case _ => deserializationError("Object expected in field '" + fieldName + "'") + case _ => deserializationError("Object expected in field '" + fieldName + "'", fieldNames = fieldName :: Nil) } protected def extractFieldNames(classManifest: ClassManifest[_]): Array[String] = { |