Throwing an exception looks exactly the same as in java.
In Scala, the throw expression also has a result type.

here, if n is even, the return value will be half of n. If n is
not even, an exception will be thrown before anything can be
returned at all. Because of this, it is safe to treat a thrown
exception as any kind of value whatsoever. Any context that tries
to use the return from a throw will never get to do so, and thus
no harm will come.

Technically, an exception throw has type Nothing. You can use a
throw as an expression even though it will never actually evaluate
to anything. This little bit of technical gymnastics might sound
weird, but is frequently useful in cases such as this. Once branch
of an if computes a value, while the other throws an exception and
computes Nothing. The type of the whole if expresssion is then
the type of the branch which does compute something.