September 2013
Intermediate to advanced
548 pages
12h 25m
English
If an Erlang process crashes, we might get an error message.
To see the error message, some other process has to monitor
the crashing process and print an error message when the
monitored process dies. If we just create a process with
spawn and the process dies, we won’t get any
error message. The best thing to do if we want to see all the
error messages is always to use
spawn_link.
Every time a process crashes that is linked to the shell, a stack trace will be printed. To see what’s in the stack trace, we’ll write a simple function with a deliberate error and call this function from the shell.
| lib_misc.erl | |
| | deliberate_error(A) -> |
| | bad_function(A, 12), |
| | lists:reverse(A). |
| | |
| | bad_function(A, _) -> |
| | {ok, Bin} ... |
Read now
Unlock full access