this is from raising erlang exceptions
An example of creating an Erlang exception with an exit (why).
-module(exceptions).
-export([sample_error/0]).
sample_error() -> throw("some bad happened").
Now let's compile our exception module, call the sample_error () function and observe> the output of the raised exception.
erlc βo ebin src/exceptions.erl
erl βpa ebin
1> exceptions:sample_error().
** exception throw: "some bad happened"
in function exceptions:sample_error/0
source
share