trap or not 对于link 时产生的不同的错误信息

来源:互联网 发布:parallels mac 破解版 编辑:程序博客网 时间:2024/06/13 13:01

两个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

阅读全文
0 0
原创粉丝点击