1, "b" -> 2) | env.getOrElse("c", error()) java.lang.Exception: Hey! at rs$line$1$.error(rs$line$1:1) at rs$line$1$.$init$$$anonfun$1(rs$line$1:4) at scala.collection.immutable.Map$Map2.getOrElse(Map.scala:325)"> 1, "b" -> 2) | env.getOrElse("c", error()) java.lang.Exception: Hey! at rs$line$1$.error(rs$line$1:1) at rs$line$1$.$init$$$anonfun$1(rs$line$1:4) at scala.collection.immutable.Map$Map2.getOrElse(Map.scala:325)"> 1, "b" -> 2) | env.getOrElse("c", error()) java.lang.Exception: Hey! at rs$line$1$.error(rs$line$1:1) at rs$line$1$.$init$$$anonfun$1(rs$line$1:4) at scala.collection.immutable.Map$Map2.getOrElse(Map.scala:325)">
scala> def error(): Nothing = throw Exception("Hey!")
     |
     | val env = Map("a" -> 1, "b" -> 2)
     | env.getOrElse("c", error())
java.lang.Exception: Hey!
  at rs$line$1$.error(rs$line$1:1)
  at rs$line$1$.$init$$$anonfun$1(rs$line$1:4)
  at scala.collection.immutable.Map$Map2.getOrElse(Map.scala:325)
>>> def error():
...    raise ValueError("Hey!")
...
>>> d = {"a": 1, "b": 2}
>>> d.get("c", error)
<function error at 0x100d0fe20>
>>> d.get("c", error())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in error
ValueError: Hey!