diff options
author | Mathias <mathias@spray.cc> | 2011-12-07 10:38:29 +0100 |
---|---|---|
committer | Mathias <mathias@spray.cc> | 2011-12-07 10:38:29 +0100 |
commit | 6a5ccb2e6c37f7922db34f29c1f9cfd61a2397e8 (patch) | |
tree | 5b58cf9463bf300e92f6eedb5042f5e4c5b6e93a /src/main/scala/cc/spray/json/ProductFormats.scala | |
parent | fd80c9099d4d474a6080df11a5786bd7e9b5cb7f (diff) | |
download | spray-json-6a5ccb2e6c37f7922db34f29c1f9cfd61a2397e8.tar.gz spray-json-6a5ccb2e6c37f7922db34f29c1f9cfd61a2397e8.tar.bz2 spray-json-6a5ccb2e6c37f7922db34f29c1f9cfd61a2397e8.zip |
Move exception into package.scala, simplify throwing of (De)SerializationExceptions
Diffstat (limited to 'src/main/scala/cc/spray/json/ProductFormats.scala')
-rw-r--r-- | src/main/scala/cc/spray/json/ProductFormats.scala | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/scala/cc/spray/json/ProductFormats.scala b/src/main/scala/cc/spray/json/ProductFormats.scala index d82cbf9..6a79f5f 100644 --- a/src/main/scala/cc/spray/json/ProductFormats.scala +++ b/src/main/scala/cc/spray/json/ProductFormats.scala @@ -16,8 +16,6 @@ package cc.spray.json -import annotation.tailrec - /** * Provides the helpers for constructing custom JsonFormat implementations for types implementing the Product trait * (especially case classes) @@ -416,9 +414,9 @@ trait ProductFormats { catch { case e: NoSuchElementException if !fieldFound => if (reader.isInstanceOf[OptionFormat[_]]) None.asInstanceOf[T] - else throw new DeserializationException("Object is missing required member '" + fieldName + "'", e) + else deserializationError("Object is missing required member '" + fieldName + "'", e) } - case _ => throw new DeserializationException("Object expected") + case _ => deserializationError("Object expected") } } } |