From cadc4f3e99938f3928fb7b9c1b22a696b2cd6b1e Mon Sep 17 00:00:00 2001 From: Johannes Rudolph Date: Tue, 11 Mar 2014 16:51:55 +0100 Subject: Only catch NonFatal exceptions --- src/main/scala/spray/json/ProductFormats.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/scala') 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) } } -- cgit v1.2.3