Failure

fastparse.Parsed$.Failure
See theFailure companion object
final class Failure(val label: String, val index: Int, val extra: Extra) extends Parsed[Nothing]

The outcome of a failed parse

Attributes

extra

Metadata about the parse; useful for re-running the parse to trace out a more detailed error report

index

The index at which the parse failed

label

A hint as to why the parse failed. Defaults to "", unless you set verboseFailures = true or call .trace() on an existing failure

Companion:
object
Graph
Supertypes
class Parsed[Nothing]
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def fold[V](onFailure: (String, Int, Extra) => V, onSuccess: (Nothing, Int) => V): V
def get: Success[Nothing]
def longMsg: String

Displays the failure message including the parse stack, if possible

Displays the failure message including the parse stack, if possible

Attributes

def msg: String

Displays the failure message excluding the parse stack

Displays the failure message excluding the parse stack

Attributes

override 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.

Definition Classes
Any
def trace(enableLogging: Boolean): TracedFailure

Re-runs the failed parse with verboseFailures turned on and failure aggregation enabled. This allows Fastparse to provide much more detailed error messages, at a cost of taking ~2x as long than the original parse.

Re-runs the failed parse with verboseFailures turned on and failure aggregation enabled. This allows Fastparse to provide much more detailed error messages, at a cost of taking ~2x as long than the original parse.

By default, logging is disabled during the tracing run; this is because you typically already saw the logging output during the primary parse, and the tracing run's log output should be identical. You can pass in enableLogging = true to log the tracing run as well.

Attributes

Concrete fields

val index: Int
val label: String

Inherited fields

val isSuccess: Boolean

Attributes

Inherited from:
Parsed