Skip to content
Browse files

json-ext: JsonBoxSerializer: {exn->exception}

  • Loading branch information...
1 parent a68b65d commit 9e2f87f4eb0897172cafbae5d190d15a73b94944 @nafg nafg committed Jan 7, 2013
Showing with 9 additions and 9 deletions.
  1. +9 −9 core/json-ext/src/main/scala/net/liftweb/json/ext/JsonBoxSerializer.scala
View
18 core/json-ext/src/main/scala/net/liftweb/json/ext/JsonBoxSerializer.scala
@@ -34,18 +34,18 @@ class JsonBoxSerializer extends Serializer[Box[_]] {
case JNull | JNothing => Empty
case JObject(JField("box_failure", JString("Failure")) ::
JField("msg", JString(msg)) ::
- JField("exception", exn) ::
+ JField("exception", exception) ::
JField("chain", chain) :: Nil) =>
- Failure(msg, deserializeException(exn),
+ Failure(msg, deserializeException(exception),
extract(chain, TypeInfo(BoxClass, Some(typeHoldingFailure))).asInstanceOf[Box[Failure]])
case JObject(JField("box_failure", JString("ParamFailure")) ::
JField("msg", JString(msg)) ::
- JField("exception", exn) ::
+ JField("exception", exception) ::
JField("chain", chain) ::
JField("paramType", JString(paramType)) ::
JField("param", param) :: Nil) =>
val clazz = Thread.currentThread.getContextClassLoader.loadClass(paramType)
- ParamFailure(msg, deserializeException(exn),
+ ParamFailure(msg, deserializeException(exception),
extract(chain, TypeInfo(BoxClass, Some(typeHoldingFailure))).asInstanceOf[Box[Failure]],
extract(param, TypeInfo(clazz, None)))
case x =>
@@ -57,17 +57,17 @@ class JsonBoxSerializer extends Serializer[Box[_]] {
def serialize(implicit format: Formats): PartialFunction[Any, JValue] = {
case Full(x) => decompose(x)
case Empty => JNull
- case ParamFailure(msg, exn, chain, param) =>
+ case ParamFailure(msg, exception, chain, param) =>
JObject(JField("box_failure", JString("ParamFailure")) ::
JField("msg", JString(msg)) ::
- JField("exception", serializeException(exn)) ::
+ JField("exception", serializeException(exception)) ::
JField("chain", decompose(chain)) ::
JField("paramType", JString(param.asInstanceOf[AnyRef].getClass.getName)) ::
JField("param", decompose(param)) :: Nil)
- case Failure(msg, exn, chain) =>
+ case Failure(msg, exception, chain) =>
JObject(JField("box_failure", JString("Failure")) ::
JField("msg", JString(msg)) ::
- JField("exception", serializeException(exn)) ::
+ JField("exception", serializeException(exception)) ::
JField("chain", decompose(chain)) :: Nil)
}
@@ -77,7 +77,7 @@ class JsonBoxSerializer extends Serializer[Box[_]] {
def getRawType = classOf[Box[Failure]]
}
- private def serializeException(exn: Box[Throwable]) = exn match {
+ private def serializeException(exception: Box[Throwable]) = exception match {
case Full(x) => JString(javaSerialize(x))
case _ => JNull
}

0 comments on commit 9e2f87f

Please sign in to comment.
Something went wrong with that request. Please try again.