diff options
author | Johannes Rudolph <johannes.rudolph@gmail.com> | 2013-08-16 11:21:56 +0200 |
---|---|---|
committer | Johannes Rudolph <johannes.rudolph@gmail.com> | 2013-08-16 11:21:56 +0200 |
commit | e8a7b8a73c0b42c02ca13220bf4b65f198be0d69 (patch) | |
tree | 8e2994baed77e034807bc2ed3f0bd7461cd6f72a | |
parent | 83237b4a640897a22e0800ee6609c1d309292a3b (diff) | |
download | spray-json-e8a7b8a73c0b42c02ca13220bf4b65f198be0d69.tar.gz spray-json-e8a7b8a73c0b42c02ca13220bf4b65f198be0d69.tar.bz2 spray-json-e8a7b8a73c0b42c02ca13220bf4b65f198be0d69.zip |
improved error message and fixed test, refs #62
-rw-r--r-- | src/main/scala/spray/json/ProductFormats.scala | 2 | ||||
-rw-r--r-- | src/test/scala/spray/json/ProductFormatsSpec.scala | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/scala/spray/json/ProductFormats.scala b/src/main/scala/spray/json/ProductFormats.scala index c3a94e1..8b5843f 100644 --- a/src/main/scala/spray/json/ProductFormats.scala +++ b/src/main/scala/spray/json/ProductFormats.scala @@ -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 + "'") } } diff --git a/src/test/scala/spray/json/ProductFormatsSpec.scala b/src/test/scala/spray/json/ProductFormatsSpec.scala index af04505..c969a6f 100644 --- a/src/test/scala/spray/json/ProductFormatsSpec.scala +++ b/src/test/scala/spray/json/ProductFormatsSpec.scala @@ -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'")) ) } |