A SchemaError reports why decoding, conversion or validation failed. It holds one or more SchemaError.Single failures, each with the path (DynamicOptic) of the place in the data where it happened. Schema#fromDynamicValue collects the failures of all record fields in one error, while the JSON codec stops at the first failure.
It extends Exception without a stack trace, so a Schema#transform function can throw it: the path of a failure says where it happened, not the stack.
val error = SchemaError.missingField(Nil, "title").atField("book") ++
SchemaError.validationFailed("year must be positive").atField("year")
val text = error.message
// Missing field 'title' at: .book
// year must be positive at: .year
Attributes
- See also
- Companion
- object
- Source
- SchemaError.scala
- Graph
-
- Supertypes
-
trait Producttrait Equalstrait NoStackTraceclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Returns an error with the failures of this error followed by those of other.
Returns an error with the failures of this error followed by those of other.
Attributes
- Source
- SchemaError.scala
Prepends a case access to the path of all errors in this SchemaError.
Prepends a case access to the path of all errors in this SchemaError.
Attributes
- Source
- SchemaError.scala
Prepends a field access to the path of all errors in this SchemaError.
Prepends a field access to the path of all errors in this SchemaError.
Attributes
- Source
- SchemaError.scala
Prepends an index access to the path of all errors in this SchemaError.
Prepends an index access to the path of all errors in this SchemaError.
Attributes
- Source
- SchemaError.scala
Prepends a map key access to the path of all errors in this SchemaError.
Prepends a map key access to the path of all errors in this SchemaError.
Attributes
- Source
- SchemaError.scala
Attributes
- Definition Classes
- Source
- SchemaError.scala
The messages of all failures, one per line.
Inherited methods
Attributes
- Inherited from:
- Throwable
Attributes
- Definition Classes
-
NoStackTrace -> Throwable
- Inherited from:
- NoStackTrace
- Source
- NoStackTrace.scala
Attributes
- Inherited from:
- Throwable
Attributes
- Inherited from:
- Throwable
Attributes
- Inherited from:
- Throwable
Attributes
- Inherited from:
- Throwable
Attributes
- Inherited from:
- Throwable
Attributes
- Inherited from:
- Throwable
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
- Source
- Product.scala
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
- Source
- Product.scala
Attributes
- Inherited from:
- Throwable