org.scalatest

class StackDepthException

[source: org/scalatest/StackDepthException.scala]

abstract class StackDepthException(val message : scala.Option[java.lang.String], val cause : scala.Option[java.lang.Throwable], val failedCodeStackDepth : Int)
extends java.lang.RuntimeException with StackDepth
Exception class that encapsulates information about the stack depth at which the line of code that failed resides, so that information can be presented to the user that makes it quick to find the failing line of code. (In other words, the user need not scan through the stack trace to find the correct filename and line number of the problem code.) Having a stack depth is more useful in a testing environment in which test failures are implemented as thrown exceptions, as is the case in ScalaTest's built-in suite traits.
Parameters
message - an optional detail message for this StackDepthException.
cause - an optional cause, the Throwable that caused this StackDepthException to be thrown.
failedCodeStackDepth - the depth in the stack trace of this exception at which the line of test code that failed resides.
Throws
NullPointerException - if message is null, or Some(null).
NullPointerException - if cause is null, or Some(null).
Author
Bill Venners
Direct Known Subclasses:
DuplicateTestNameException, NotAllowedException, TestFailedException, TestRegistrationClosedException

Values and Variables inherited from StackDepth
failedCodeFileNameAndLineNumberString
Method Summary
override final def initCause (throwable : java.lang.Throwable) : java.lang.Throwable
Methods inherited from java.lang.Throwable
java.lang.Throwable.getMessage, java.lang.Throwable.getLocalizedMessage, java.lang.Throwable.getCause, java.lang.Throwable.toString, java.lang.Throwable.printStackTrace, java.lang.Throwable.printStackTrace, java.lang.Throwable.printStackTrace, java.lang.Throwable.fillInStackTrace, java.lang.Throwable.getStackTrace, java.lang.Throwable.setStackTrace
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
override final def initCause(throwable : java.lang.Throwable) : java.lang.Throwable


Copyright (C) 2001-2009 Artima, Inc. All rights reserved.