-module(exception). -export([exception/0]). f() -> throw("exception"). exception() -> X = try f() catch throw : Y -> "catch : " ++ Y end, io:format(X).