object JsError extends Serializable
- Source
- JsResult.scala
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- JsError
- Serializable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- def apply(path: JsPath, error: String): JsError
- def apply(path: JsPath, error: JsonValidationError): JsError
- def apply(error: (, JsonValidationError)): JsError
- def apply(error: String): JsError
- def apply(error: JsonValidationError): JsError
- def apply(): JsError
- def merge(e1: JsError, e2: JsError): JsError
- def merge(e1: Seq[(JsPath, Seq[JsonValidationError])], e2: Seq[(JsPath, Seq[JsonValidationError])]): Seq[(JsPath, Seq[JsonValidationError])]
- def toFlatForm(e: JsError): Seq[(String, Seq[JsonValidationError])]
- def toJson(errors: Seq[(JsPath, Seq[JsonValidationError])]): JsObject
- def toJson(e: JsError): JsObject
- object Detailed
Extracts the first error details (message and its first argument).
Extracts the first error details (message and its first argument).
import play.api.libs.json.JsError def cause(err: JsError): Option[(String, Exception)] = err match { case JsError.Detailed(msg, ex: Exception) => Some(msg -> ex) case _ => None }
- object Message
Extracts the first error message.
Extracts the first error message.
import play.api.libs.json.JsError def msg(err: JsError): Option[String] = err match { case JsError.Message(msg) => Some(msg) case _ => None }