diff options
author | Johannes Rudolph <johannes.rudolph@gmail.com> | 2014-03-11 16:51:55 +0100 |
---|---|---|
committer | Johannes Rudolph <johannes.rudolph@gmail.com> | 2014-03-11 16:51:55 +0100 |
commit | cadc4f3e99938f3928fb7b9c1b22a696b2cd6b1e (patch) | |
tree | f847d90fcf91b3f728a6a6f567604bc12073c10b | |
parent | af38d4df5a099acaba859ea8364a573ac35b8dfe (diff) | |
download | spray-json-cadc4f3e99938f3928fb7b9c1b22a696b2cd6b1e.tar.gz spray-json-cadc4f3e99938f3928fb7b9c1b22a696b2cd6b1e.tar.bz2 spray-json-cadc4f3e99938f3928fb7b9c1b22a696b2cd6b1e.zip |
Only catch NonFatal exceptions
-rw-r--r-- | src/main/scala/spray/json/ProductFormats.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/scala/spray/json/ProductFormats.scala b/src/main/scala/spray/json/ProductFormats.scala index ad57221..971c7a6 100644 --- a/src/main/scala/spray/json/ProductFormats.scala +++ b/src/main/scala/spray/json/ProductFormats.scala @@ -17,6 +17,7 @@ package spray.json import java.lang.reflect.Modifier +import scala.util.control.NonFatal /** * Provides the helpers for constructing custom JsonFormat implementations for types implementing the Product trait @@ -70,7 +71,7 @@ trait ProductFormats extends ProductFormatsInstances { sys.error("Cannot determine field order of case class " + clazz.getName) fields.map(_.getName) } catch { - case ex => throw new RuntimeException("Cannot automatically determine case class field names and order " + + case NonFatal(ex) => throw new RuntimeException("Cannot automatically determine case class field names and order " + "for '" + clazz.getName + "', please use the 'jsonFormat' overload with explicit field name specification", ex) } } |