Skip to content

Commit

Permalink
improved error message and fixed test, refs #62
Browse files Browse the repository at this point in the history
  • Loading branch information
jrudolph committed Aug 16, 2013
1 parent 83237b4 commit e8a7b8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/spray/json/ProductFormats.scala
Expand Up @@ -50,7 +50,7 @@ trait ProductFormats extends ProductFormatsInstances {
if (reader.isInstanceOf[OptionFormat[_]]) None.asInstanceOf[T]
else deserializationError("Object is missing required member '" + fieldName + "'", e)
}
case _ => deserializationError("Object expected in field " + fieldName)
case _ => deserializationError("Object expected in field '" + fieldName + "'")
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/spray/json/ProductFormatsSpec.scala
Expand Up @@ -62,7 +62,7 @@ class ProductFormatsSpec extends Specification {
JsObject("b" -> JsNumber(4.2), "a" -> JsNumber(42)).convertTo[Test2] mustEqual obj
}
"throw a DeserializationException if the JsValue is not a JsObject" in (
JsNull.convertTo[Test2] must throwA(new DeserializationException("Object expected"))
JsNull.convertTo[Test2] must throwA(new DeserializationException("Object expected in field 'a'"))
)
}

Expand Down

0 comments on commit e8a7b8a

Please sign in to comment.