JsError

object JsError
Companion
class
trait Product
trait Mirror
class Object
trait Matchable
class Any

Type members

Classlikes

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
}

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from
Mirror

Value members

Concrete methods

def apply(): JsError
def apply(error: String): JsError
def apply(path: JsPath, error: String): JsError
def merge(e1: Seq[(JsPath, Seq[JsonValidationError])], e2: Seq[(JsPath, Seq[JsonValidationError])]): Seq[(JsPath, Seq[JsonValidationError])]
def merge(e1: JsError, e2: JsError): JsError
def toFlatForm(e: JsError): Seq[(String, Seq[JsonValidationError])]
def toJson(errors: Seq[(JsPath, Seq[JsonValidationError])]): JsObject