OpticCheck

zio.blocks.schema.OpticCheck
See theOpticCheck companion object
final case class OpticCheck(errors: ::[Single]) extends Exception, NoStackTrace

The reason an optic could not reach its focus. The *OrFail methods of Optic return it in a Left, Optic#check returns it, and so does SchemaExpr#eval when evaluation fails.

It holds one or more problems (OpticCheck.Single). Each one is an error (OpticCheck.Error: another case of a variant, a failing wrapper, a failed conversion) or a warning (OpticCheck.Warning: an empty collection, an index past the end, a missing key). Each problem carries the path of the whole optic and the path up to the step where it was found, rendered in its message with DynamicOptic#toScalaString:

During attempted access at .tags.at(0), encountered a sequence out of bounds at .tags.at(0): index is 0, but size is 0

An OpticCheck is also an exception without a stack trace, whose message is message.

Attributes

See also
Companion
object
Source
OpticCheck.scala
Graph
Supertypes
trait Product
trait Equals
trait NoStackTrace
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def ++(other: OpticCheck): OpticCheck

Returns a check with the problems of this one followed by those of other.

Returns a check with the problems of this one followed by those of other.

Attributes

Source
OpticCheck.scala
override def getMessage: String

Returns message.

Returns message.

Attributes

Definition Classes
Source
OpticCheck.scala
def hasError: Boolean

Returns true if at least one problem is an error.

Returns true if at least one problem is an error.

Attributes

Source
OpticCheck.scala
def hasWarning: Boolean

Returns true if at least one problem is a warning.

Returns true if at least one problem is a warning.

Attributes

Source
OpticCheck.scala
def message: String

The messages of all problems, one per line.

The messages of all problems, one per line.

Attributes

Source
OpticCheck.scala

Inherited methods

final def addSuppressed(x$0: Throwable): Unit

Attributes

Inherited from:
Throwable
override def fillInStackTrace(): Throwable

Attributes

Definition Classes
NoStackTrace -> Throwable
Inherited from:
NoStackTrace
Source
NoStackTrace.scala

Attributes

Inherited from:
Throwable

Attributes

Inherited from:
Throwable

Attributes

Inherited from:
Throwable
final def getSuppressed(): Array[Throwable]

Attributes

Inherited from:
Throwable

Attributes

Inherited from:
Throwable

Attributes

Inherited from:
Throwable

Attributes

Inherited from:
Throwable
def printStackTrace(): Unit

Attributes

Inherited from:
Throwable
def productElementNames: Iterator[String]

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
def productIterator: Iterator[Any]

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
def setStackTrace(x$0: Array[StackTraceElement]): Unit

Attributes

Inherited from:
Throwable
def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Inherited from:
Throwable