ErrorKey

org.sigilaris.core.failure.ErrorKey
See theErrorKey companion class
object ErrorKey

Factory for ErrorKey instances with pattern-based validation.

Attributes

Companion
class
Source
FailureCode.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
ErrorKey.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source
Mirror.scala
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def fromCandidate(candidate: String, fallback: String, code: FailureCode, keyPattern: Regex): ErrorKey

Builds an ErrorKey, falling back to a safe default if the candidate does not match the expected pattern.

Builds an ErrorKey, falling back to a safe default if the candidate does not match the expected pattern.

Value parameters

candidate

the proposed key string

code

the failure code to attach

fallback

the key string to use if candidate is invalid

keyPattern

regex the candidate must match

Attributes

Returns

an ErrorKey with either the candidate or fallback as rendered key

Source
FailureCode.scala