SpacException

abstract class SpacException[Self <: SpacException[Self]](val spacTrace: Chain[SpacTraceElement], val detail: Either[String, Throwable]) extends Exception with NoStackTrace

Base class for all exceptions thrown by Spac parsers. A SpacException holds a spacTrace, which is similar to a stack trace, but uses a specialized element type to hold helpful debug information about the cause and context of the exception, and the input that caused it.

SpacException uses NoStackTrace to suppress the usual stack trace, since exceptions thrown by a Parser will not have useful stack trace information for end users of the Spac framework.

Type parameters:
Self

self-type used in the type signature of withSpacTrace

Value parameters:
detail

a Left containing a spac-specific error message, or a Right containing some non-Spac exception that was caught inside a Parser

spacTrace

chain of SpacTraceElements, with the "top" of the stack at the beginning, and the "bottom" of the stack at the end

Companion:
object
trait NoStackTrace
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any

Value members

Constructors

def this(spacTrace: Chain[SpacTraceElement], spacMessage: String)
def this(spacTrace: Chain[SpacTraceElement], nonSpacCause: Throwable)

Abstract methods

def withSpacTrace(spacTrace2: Chain[SpacTraceElement]): Self

Used internally by the framework, typically in a Transformer.Handler's unwind method

Used internally by the framework, typically in a Transformer.Handler's unwind method

Concrete methods

def addEarlyTrace(firstTrace: Chain[SpacTraceElement]): Self

Used internally by the framework, typically in a Transformer.Handler's unwind method

Used internally by the framework, typically in a Transformer.Handler's unwind method

def addEarlyTrace(firstTraceElems: SpacTraceElement*): Self

Used internally by the framework, typically in a Transformer.Handler's unwind method

Used internally by the framework, typically in a Transformer.Handler's unwind method

def addTrace(nextTrace: Chain[SpacTraceElement]): Self

Used internally by the framework, typically in a Transformer.Handler's unwind method

Used internally by the framework, typically in a Transformer.Handler's unwind method

def addTrace(nextTraceElems: SpacTraceElement*): Self

Used internally by the framework, typically in a Transformer.Handler's unwind method

Used internally by the framework, typically in a Transformer.Handler's unwind method

override def fillInStackTrace(): Throwable
Definition Classes
NoStackTrace -> Throwable

Inherited methods

final def addSuppressed(x$0: Throwable): Unit
Inherited from:
Throwable
def getCause(): Throwable
Inherited from:
Throwable
def getLocalizedMessage(): String
Inherited from:
Throwable
def getMessage(): String
Inherited from:
Throwable
def getStackTrace(): Array[StackTraceElement]
Inherited from:
Throwable
final def getSuppressed(): Array[Throwable]
Inherited from:
Throwable
def initCause(x$0: Throwable): Throwable
Inherited from:
Throwable
def printStackTrace(x$0: PrintWriter): Unit
Inherited from:
Throwable
def printStackTrace(x$0: PrintStream): Unit
Inherited from:
Throwable
def printStackTrace(): Unit
Inherited from:
Throwable
Inherited from:
NoStackTrace
def setStackTrace(x$0: Array[StackTraceElement]): Unit
Inherited from:
Throwable
def toString(): String
Inherited from:
Throwable

Concrete fields

val detail: Either[String, Throwable]