object JsonValidationError extends Serializable

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

Value Members

  1. def apply(message: String, args: Any*): JsonValidationError

    import play.api.libs.json.JsonValidationError
    
    val simpleError = JsonValidationError("error.key1")
    
    val detailedError = JsonValidationError("error.key1", "details")
  2. 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.JsonValidationError
    
    def details(err: JsonValidationError): Option[(String, Any)] = err match {
      case JsonValidationError.Detailed(msg, arg) => Some(msg -> arg)
      case _ => None
    }
  3. object Message

    Extracts the first error message.

    Extracts the first error message.

    import play.api.libs.json.JsonValidationError
    
    def msg(err: JsonValidationError): Option[String] = err match {
      case JsonValidationError.Message(msg) => Some(msg)
      case _ => None
    }