throws (original) (raw)
Scala 3
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
scala.throws
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()
}
Attributes
Source
Graph
Supertypes
Members list
Value members
Constructors
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL