link error info as trap or not trap
两个erlang进程link, 在某个进程发生错误时, 所产生的错误信息
exception | not_trap | trap |
---|---|---|
spawn_link(fun() -> ok end) | nothing | {‘EXIT’, Pid, normal} |
spawn_link(fun() -> exit(reason) end) | exception exit | {‘EXIT’, Pid, reason} |
spawn_link(fun() -> exit(normal) end) | nothing | {‘EXIT’, Pid, normal} |
spawn_link(fun() -> 1/0 end) | exception exit | {‘EXIT’, Pid, reason} |
spawn_link(fun() -> error(reason) end) | exception exit | {‘EXIT’, Pid, reason} |
spawn_link(fun() -> throw(reason) end) | exception exit | {‘EXIT’, Pid, reason} |
exit(self(), normal) | exception normal | {‘EXIT’, self(), normal} |
exit(spawn_link(fun() -> … end), normal) | nothing | nothing |
exit(spawn_link(fun() -> … end, reason) | exception exit | {‘EXIT’, Pid, reason} |
exit(spawn_link(fun() -> … end), kill) | exception kill | {‘EXIT’, Pid, killed} |
exit(self(), kill) | exception killed | exception killed |
spawn_link(fun() -> exit(kill) end) | exception killed | {‘EXIT’, Pid, Kill} |
参考:
1. learnyousomeerlang # links