Throwablex

org.specs2.control.Throwablex
See theThrowablex companion object
trait Throwablex

This trait adds some utility methods to Throwable objects.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Throwablex.type

Members list

Value members

Concrete methods

def exception(m: String, st: Seq[StackTraceElement], cause: Throwable): Exception

Attributes

Returns

an exception with the given message and stacktrace

def exception(st: Seq[StackTraceElement]): Exception

Attributes

Returns

an exception with the given stacktrace

def stackTraceElement(m: String, className: String, fileName: String, lineNumber: Int): StackTraceElement

utility method to create a default stacktrace element

utility method to create a default stacktrace element

Attributes

Extensions

Extensions

extension [T <: Throwable](t: T)
def apply(i: Int): StackTraceElement

Attributes

Returns

the ith stacktrace element

def chainedExceptions: List[Throwable]

Attributes

Returns

the list of chained exceptions

def classLocation: String

Attributes

Returns

the class name and the line number where the Throwable was created

def exists(pattern: String): Boolean

Attributes

Returns

true if the pattern exists in one of the traces

def filter(pattern: String): T

Select all traces of this exception matching a given pattern

Select all traces of this exception matching a given pattern

Attributes

def filter(f: Seq[StackTraceElement] => Seq[StackTraceElement]): T

Select all traces of this exception according to filtering function WARNING: this mutates the exception to be able to retain its type!

Select all traces of this exception according to filtering function WARNING: this mutates the exception to be able to retain its type!

Attributes

def filterNot(pattern: String): T

Select all traces of this exception not matching a given pattern

Select all traces of this exception not matching a given pattern

Attributes

def fullLocation: String

Attributes

Returns

the class name, file Name and the line number where the Throwable was created

def getFullStackTrace: List[StackTraceElement]

Attributes

Returns

the list of all stacktrace elements

Attributes

Returns

the full stack trace as a string

def headOption: Option[StackTraceElement]

Attributes

Returns

the first stacktrace element as an option

def location: String

Attributes

Returns

the file name and the line number where the Throwable was created

def messageAndCause: String

Attributes

Returns

the exception message and its cause if any

def printFullStackTrace(): Unit

print all the stacktrace for t, including the traces from its causes

print all the stacktrace for t, including the traces from its causes

Attributes

def setStackTrace(st: Seq[StackTraceElement]): T

set a new stacktrace

set a new stacktrace

Attributes