Packages

object JsError extends Serializable

Source
JsResult.scala
Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsError
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def apply(path: JsPath, error: String): JsError
  2. def apply(path: JsPath, error: JsonValidationError): JsError
  3. def apply(error: (JsPath, JsonValidationError)): JsError
  4. def apply(error: String): JsError
  5. def apply(error: JsonValidationError): JsError
  6. def apply(): JsError
  7. def merge(e1: JsError, e2: JsError): JsError
  8. def merge(e1: Seq[(JsPath, Seq[JsonValidationError])], e2: Seq[(JsPath, Seq[JsonValidationError])]): Seq[(JsPath, Seq[JsonValidationError])]
  9. def toFlatForm(e: JsError): Seq[(String, Seq[JsonValidationError])]
  10. def toJson(errors: Seq[(JsPath, Seq[JsonValidationError])]): JsObject
  11. def toJson(e: JsError): JsObject
  12. 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
    }
  13. 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
    }