Class

scala

throws

Related Doc: package scala

Permalink

class throws[T <: Throwable] extends Annotation with StaticAnnotation

Annotation for specifying the exceptions thrown by a method. For example:

class Reader(fname: String) {
  private val in = new BufferedReader(new FileReader(fname))
  @throws[IOException]("if the file doesn't exist")
  def read() = in.read()
}
Source
throws.scala
Version

1.0, 19/05/2006

Since

2.1

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. throws
  2. StaticAnnotation
  3. Annotation
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new throws(clazz: Class[T])

    Permalink
  2. new throws(cause: String = "")

    Permalink