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

两个erlang进程link, 在某个进程发生错误时, 所产生的错误信息

exceptionnot_traptrap
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)nothingnothing
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 killedexception killed
spawn_link(fun() -> exit(kill) end)exception killed{‘EXIT’, Pid, Kill}

参考:
1. learnyousomeerlang # links

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值